IPython tab completes only some modules

会有一股神秘感。 提交于 2019-12-04 06:57:35

I found an answer to this question yesterday, after I got tired of this behavior.

It seems that IPython has a simple database with all the modules it can find in sys.path. Every time you install a new module you have to write the magic

In [1]: %rehashx

so that IPython regenerates its database. Then you can have TAB-completion of new modules.

right at the end of Ipython/completer.py is this code:


        except:
            #from IPython.ultraTB import AutoFormattedTB; # dbg
            #tb=AutoFormattedTB('Verbose');tb() #dbg
# If completion fails, don't annoy the user. return None

Perhaps uncommenting it will give you a clue

Locally installed, non-egg modules can have their name tab-completed, when doing import, but egg modules cannot (IPython 0.10, Python 2.6.2, Mac OS X).

I would suggest to file a feature request / bug report with IPython!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!