2013-06-05 18 views
1

(檢查是否有更好的解釋編輯)不規則模塊檢測/自動完成

(截圖是內置在pycharm蟒蛇控制檯它使用IPython的。存在同樣的問題,如果我單獨使用IPython中也 enter image description here 在IPython控制檯中,如果我輸入from gi.repository import並按Tab鍵查看可用選項,我沒有看到任何這些模塊(Glib,RB,Gtk,Gio等)但如果我執行from gi.repository import RBGtk它工作!即使它不應該根據我的自動完成列表。 然後,如果我輸入from gi.repository import並按Tab鍵,我看到之前導入的模塊。與列表中的任何其他模塊相同。 這是怎麼回事?它在PyCharm中導致錯誤地報告的錯誤(正如你在屏幕截圖中看到的那樣)。

編輯:爲了說明問題更好:

明白我的意思嗎?起初它只顯示RBabsolute_import作爲選擇。仍然能夠導入Gtk。之後,它顯示了更多選擇。仍然不是一個完整的模塊列表。

enter image description here

回答

0

重建可用模塊列表:%rehashx cf %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

不,它似乎並沒有解決任何問題。請檢查編輯以更好地解釋問題。 – user1265125