【问题标题】:For newly installed modules, how do I get `ipython` import autocomplete to work?对于新安装的模块,如何让 `ipython` 导入自动完成功能工作?
【发布时间】:2012-02-27 09:22:03
【问题描述】:

我刚刚在我的计算机中安装了 sqlalchemy 模块,但是当我在 ipython 提示符中键入 import sqlTAB 时,自动完成只建议我内置 sqlite3 模块。

如何让 ipython 在导入自动完成时也建议 sqlalchemy

【问题讨论】:

    标签: python autocomplete module ipython


    【解决方案1】:

    根据此消息,

    In [1]: import sq[TAB]
    Caching the list of root modules, please wait!
    (This will only be done once - type '%rehashx' to reset cache!)
    

    你试过%rehashx吗?

    【讨论】:

    • 退出 ipython 是不够的(我已经做了很多次了),但是 %rehashx 有效!
    • 有人知道如何在安装过程中触发这个吗?我在这里看到了函数,但不知道如何访问它: ipython.git $ git grep rehashx IPython/config/profile/pysh/ipython_config.py:%rehashx IPython/core/completerlib.py: print("(This只会执行一次 - 在“ IPython/core/magics/osm.py: 和 %rehashx 函数中键入 '%rehashx',它们会自动为 IPython/core/magics/osm.py 创建别名:def rehashx(self, parameter_s =''):
    猜你喜欢
    • 1970-01-01
    • 2015-01-09
    • 1970-01-01
    • 2020-09-08
    • 2014-02-13
    • 2019-09-26
    • 1970-01-01
    • 2013-04-05
    • 2017-03-25
    相关资源
    最近更新 更多