(屏幕快照是使用ipython的pycharm中内置的python控制台的图。如果我也单独使用ipython,也会出现相同的问题。 在IPython控制台中,如果键入from gi.repository import并按Tab键查看可用选项,则看不到任何这些模块(油腔滑调,RB,GTK,吉奥等)。但如果我执行的from gi.repository import RB或Gtk等,它的工作原理!虽然它不应该根据我的自动完成列表中。然后,如果我输入from gi.repository import,然后按Tab,我看到了我模块以前导入的,与列表中的任何其他模块相同,这是为什么呢?这会导致PyCharm中错误报告的错误(如您在屏幕截图中所见)。为了更好地说明问题:明白了吗?起初它只是显示RB和absolute_import作为选择。仍然可以导入Gtk。之后,它显示了更多其他选择。仍然不是模块的完整列表。
3 回答

慕雪6442864
TA贡献1812条经验 获得超5个赞
重建可用模块列表:%rehashxcf %rehashx?,最后一段。
Update the alias table with all executable files in $PATH.
This version explicitly checks that every entry in $PATH is a file
with 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 config
variable win_exec_ext. This defaults to 'exe|com|bat'.
This function also resets the root module cache of module completer,
used on slow filesystems.
添加回答
举报
0/150
提交
取消