`ipython` tab autocomplete does not work on imported module

后端 未结 14 1807
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 21:10

Tab completion on IPython seems not to be working. For example,

import numpy
numpy.

simply adds a tab.

import nu         


        
14条回答
  •  独厮守ぢ
    2020-11-29 21:34

    If you use Jupyter notebook and you still did get Tab auto-complete working after you tried all the steps suggested in the post here, you might want to check if you are trying to use the Tab auto-completion within a function definition. Ifyour import statements are part of the function such as below, you will not get the Tab auto-completion. You need to put the import statements outside the function and also execute them once before asking for auto-completion on the packages.

    def myfunction():
        import pandas as pd
        import numpy as np
    
        a = pd.DataFrame(np.random.normal(1,3, (4,4))
        return a
    

提交回复
热议问题