2013-12-08 39 views
0

看來我無法找到一種方法來使用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 
+0

你能給一個例子什麼不是自動完成? (如果事情在PYTHONPATH中正確的,事情應該默認工作) –

+0

@FabioZadrozny我已經編輯了你需要的問題。謝謝你的評論。 –

回答

0

我終於找到了PySide,它是一個綁定到QT庫。它在MIT許可證下發布,並與Mac OS 10.9.3上的PyDev 2.8和Eclipse Kepler配合使用。

+1

注意PySide不能與python3一起工作(但是 - 但是沒有切換的真正計劃) - 這是不好的。 – nerdoc

1

看來事情很到位...的PyDev 2.8。當事情發生變化時,x在設置PYTHONPATH時確實存在一些問題,因此,理想情況下,請嘗試每晚構建(有關獲取詳細信息,請參閱:http://pydev.org/download.html),並查看它是否爲您解決問題。

請注意,在PyDev 3.x中,您需要指出Eclipse使用Java 7 JVM(有些用戶似乎在使Eclipse成爲適當的Java虛擬機時遇到問題,特別是在Mac OS上 - 如果您遇到此問題,也許你可以檢查LiClipse 0.9.0 - 這主要是PyDev standalone +一些其他細節的分佈+直接支持PyDev的方法 - 它有PyDev 3內置 - 否則,請看https://stackoverflow.com/a/20477000/110451如何配置它)。

+0

感謝您的回覆和您的時間。我嘗試了LiCplise方法,但這並沒有解決問題。 –

+0

Humm,還有一件事要檢查:你是否嘗試添加'PyQt5' - 甚至是'PyQt5.QtCore'給強制內建函數? (有關詳細信息,請參閱http://pydev.org/manual_101_interpreter.html)。 –

+0

另外,您是否檢查/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages是否位於首選項> pydev>解釋器> python解釋器>庫中的路徑中? –

相關問題