IPython中不规则的模块检测/自动完成

(屏幕快照是使用ipython的pycharm中内置的python控制台的图。如果我也单独使用ipython,也会出现相同的问题。 

http://img4.mukewang.com/60628b0b000161ea13640766.jpg

在IPython控制台中,如果键入from gi.repository import并按Tab键查看可用选项,则看不到任何这些模块(油腔滑调,RB,GTK,吉奥等)。但如果我执行的from gi.repository import RBGtk等,它的工作原理!虽然它不应该根据我的自动完成列表中。然后,如果我输入from gi.repository import,然后按Tab,我看到了我模块以前导入的,与列表中的任何其他模块相同,这是为什么呢?这会导致PyCharm中错误报告的错误(如您在屏幕截图中所见)。

为了更好地说明问题:

明白了吗?起初它只是显示RBabsolute_import作为选择。仍然可以导入Gtk。之后,它显示了更多其他选择。仍然不是模块的完整列表。

http://img4.mukewang.com/60628b2100018d1506940351.jpg


慕的地8271018
浏览 144回答 3
3回答

慕雪6442864

重建可用模块列表:%rehashxcf %rehashx?,最后一段。Update the alias table with all executable files in $PATH.This version explicitly checks that every entry in $PATH is a filewith execute access (os.X_OK), so it is much slower than %rehash.Under Windows, it checks executability as a match against a'|'-separated string of extensions, stored in the IPython configvariable win_exec_ext.  This defaults to 'exe|com|bat'.This function also resets the root module cache of module completer,used on slow filesystems.
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python