看來我無法找到一種方法來使用PyDev 2.8在Eclipse中爲PyQt5啓用自動填充功能。我正在運行Mac OS 10.9 Mavericks。有沒有辦法使用Eclipse Kepler和PyDev 2.8爲PyQt5啓用自動完成功能?
在安裝PyQt5時,我注意到在PyQt5的默認庫路徑中沒有安裝'.py'模塊,但只安裝了'.sip'文件。這可能是問題的原因嗎?如果是,是否存在解決方法?
實施例:
from PyQt5.QtCore import *
QA #here I'd expect QApplication appear as suggestion but it doesn't
注意:這僅僅是一個例子。自動完成不會顯示PyQt5中的任何模塊,類,方法,函數或任何內容。
以下是PYTHONPATH變量的值:
macbookpro:~ giovanni$ echo $PYTHONPATH
:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
在這裏,文件和顯示目錄的有上市:
macbookpro:site-packages giovanni$ ls -haltR
total 0
drwxr-xr-x 26 root wheel 884B 6 Dic 12:51 PyQt5
drwxr-xr-x 3 root wheel 102B 6 Dic 12:51 .
drwxr-xr-x 649 root wheel 22K 6 Dic 12:51 ..
./PyQt5:
total 36408
drwxr-xr-x 26 root wheel 884B 6 Dic 12:51 .
-rwxr-xr-x 1 root wheel 12K 6 Dic 12:51 Qt.so
-rwxr-xr-x 1 root wheel 440K 6 Dic 12:51 QtDesigner.so
-rwxr-xr-x 1 root wheel 207K 6 Dic 12:51 QtXmlPatterns.so
-rwxr-xr-x 1 root wheel 280K 6 Dic 12:51 _QOpenGLFunctions_2_0.so
[email protected] 1 root wheel 826B 6 Dic 12:51 __init__.py
[email protected] 15 root wheel 510B 6 Dic 12:51 uic
-rwxr-xr-x 1 root wheel 95K 6 Dic 12:51 QtSerialPort.so
-rwxr-xr-x 1 root wheel 379K 6 Dic 12:51 QtSql.so
-rwxr-xr-x 1 root wheel 128K 6 Dic 12:51 QtSvg.so
-rwxr-xr-x 1 root wheel 116K 6 Dic 12:51 QtTest.so
-rwxr-xr-x 1 root wheel 211K 6 Dic 12:51 QtWebKit.so
-rwxr-xr-x 1 root wheel 358K 6 Dic 12:51 QtWebKitWidgets.so
-rwxr-xr-x 1 root wheel 5,8M 6 Dic 12:51 QtWidgets.so
-rwxr-xr-x 1 root wheel 729K 6 Dic 12:51 QtMultimedia.so
-rwxr-xr-x 1 root wheel 137K 6 Dic 12:51 QtMultimediaWidgets.so
-rwxr-xr-x 1 root wheel 861K 6 Dic 12:51 QtNetwork.so
-rwxr-xr-x 1 root wheel 153K 6 Dic 12:51 QtOpenGL.so
-rwxr-xr-x 1 root wheel 266K 6 Dic 12:51 QtPrintSupport.so
-rwxr-xr-x 1 root wheel 595K 6 Dic 12:51 QtQml.so
-rwxr-xr-x 1 root wheel 920K 6 Dic 12:51 QtQuick.so
-rwxr-xr-x 1 root wheel 327K 6 Dic 12:51 QtSensors.so
drwxr-xr-x 3 root wheel 102B 6 Dic 12:51 ..
-rwxr-xr-x 1 root wheel 2,7M 6 Dic 12:51 QtCore.so
-rwxr-xr-x 1 root wheel 3,0M 6 Dic 12:51 QtGui.so
-rwxr-xr-x 1 root wheel 148K 6 Dic 12:51 QtHelp.so
./PyQt5/uic:
total 200
[email protected] 15 root wheel 510B 6 Dic 12:51 .
drwxr-xr-x 26 root wheel 884B 6 Dic 12:51 ..
[email protected] 9 root wheel 306B 6 Dic 12:51 Compiler
[email protected] 5 root wheel 170B 6 Dic 12:51 Loader
[email protected] 1 root wheel 8,5K 6 Dic 12:51 __init__.py
[email protected] 1 root wheel 4,0K 6 Dic 12:51 driver.py
[email protected] 1 root wheel 2,1K 6 Dic 12:51 exceptions.py
[email protected] 1 root wheel 5,0K 6 Dic 12:51 icon_cache.py
[email protected] 1 root wheel 5,3K 6 Dic 12:51 objcreator.py
[email protected] 9 root wheel 306B 6 Dic 12:51 port_v2
[email protected] 9 root wheel 306B 6 Dic 12:51 port_v3
[email protected] 1 root wheel 18K 6 Dic 12:51 properties.py
[email protected] 1 root wheel 2,7K 6 Dic 12:51 pyuic.py
[email protected] 1 root wheel 35K 6 Dic 12:51 uiparser.py
[email protected] 7 root wheel 238B 6 Dic 12:51 widget-plugins
./PyQt5/uic/Compiler:
total 104
[email protected] 9 root wheel 306B 6 Dic 12:51 .
[email protected] 15 root wheel 510B 6 Dic 12:51 ..
[email protected] 1 root wheel 1,0K 6 Dic 12:51 __init__.py
[email protected] 1 root wheel 4,4K 6 Dic 12:51 compiler.py
[email protected] 1 root wheel 2,7K 6 Dic 12:51 indenter.py
[email protected] 1 root wheel 2,5K 6 Dic 12:51 misc.py
[email protected] 1 root wheel 4,2K 6 Dic 12:51 proxy_metaclass.py
[email protected] 1 root wheel 5,5K 6 Dic 12:51 qobjectcreator.py
[email protected] 1 root wheel 16K 6 Dic 12:51 qtproxies.py
./PyQt5/uic/Loader:
total 32
[email protected] 5 root wheel 170B 6 Dic 12:51 .
[email protected] 15 root wheel 510B 6 Dic 12:51 ..
[email protected] 1 root wheel 1,0K 6 Dic 12:51 __init__.py
[email protected] 1 root wheel 3,0K 6 Dic 12:51 loader.py
[email protected] 1 root wheel 4,9K 6 Dic 12:51 qobjectcreator.py
./PyQt5/uic/port_v2:
total 56
[email protected] 9 root wheel 306B 6 Dic 12:51 .
[email protected] 15 root wheel 510B 6 Dic 12:51 ..
[email protected] 1 root wheel 1,0K 6 Dic 12:51 __init__.py
[email protected] 1 root wheel 1,4K 6 Dic 12:51 as_string.py
[email protected] 1 root wheel 1,3K 6 Dic 12:51 ascii_upper.py
[email protected] 1 root wheel 1,5K 6 Dic 12:51 invoke.py
[email protected] 1 root wheel 1,5K 6 Dic 12:51 load_plugin.py
[email protected] 1 root wheel 1,2K 6 Dic 12:51 proxy_base.py
[email protected] 1 root wheel 1,1K 6 Dic 12:51 string_io.py
./PyQt5/uic/port_v3:
total 56
[email protected] 9 root wheel 306B 6 Dic 12:51 .
[email protected] 15 root wheel 510B 6 Dic 12:51 ..
[email protected] 1 root wheel 1,0K 6 Dic 12:51 __init__.py
[email protected] 1 root wheel 1,4K 6 Dic 12:51 as_string.py
[email protected] 1 root wheel 1,3K 6 Dic 12:51 ascii_upper.py
[email protected] 1 root wheel 1,5K 6 Dic 12:51 invoke.py
[email protected] 1 root wheel 1,5K 6 Dic 12:51 load_plugin.py
[email protected] 1 root wheel 1,2K 6 Dic 12:51 proxy_base.py
[email protected] 1 root wheel 1,0K 6 Dic 12:51 string_io.py
./PyQt5/uic/widget-plugins:
total 40
[email protected] 7 root wheel 238B 6 Dic 12:51 .
[email protected] 15 root wheel 510B 6 Dic 12:51 ..
[email protected] 1 root wheel 1,5K 6 Dic 12:51 qaxcontainer.py
[email protected] 1 root wheel 1,5K 6 Dic 12:51 qscintilla.py
[email protected] 1 root wheel 1,5K 6 Dic 12:51 qtdeclarative.py
[email protected] 1 root wheel 1,6K 6 Dic 12:51 qtprintsupport.py
[email protected] 1 root wheel 2,4K 6 Dic 12:51 qtwebkit.py
你能給一個例子什麼不是自動完成? (如果事情在PYTHONPATH中正確的,事情應該默認工作) –
@FabioZadrozny我已經編輯了你需要的問題。謝謝你的評論。 –