我跟着上的說明:這裏找到如何檢查PyQt5在Mac上是否正確安裝?
http://pyqt.sourceforge.net/Docs/sip4/installation.html
然後PyQt5按照下列指示:
http://danmarner.com/2014/04/23/Installing-PyQt5-with-Python-3-On-OS-X.html
按照這個網址的指示先安裝SIP
http://pyqt.sourceforge.net/Docs/PyQt5/installation.html
然後brew install qt5
但是當我運行的第一個例子PyQt-gpl-5.3.2/examples/tutorials/addressbook/part1.py
它失敗,出現以下:
Traceback (most recent call last):
File "examples/tutorials/addressbook/part1.py", line 45, in <module>
from PyQt5.QtCore import Qt
ImportError: No module named PyQt5.QtCore
我運行小牛10.9.5和Python 2.7.5
一點也沒有」 t看起來似乎安裝正確,或者如果它是python找不到它。我不知道如何繼續,所以任何建議都非常感謝!
Python和QT5需要通過BREW進行安裝。釀造需要在你的道路上。 – Kash 2014-12-05 19:31:02
謝謝@Kash,我用自制軟件安裝了python,它似乎在我的路徑'/ usr/local/bin'中,但運行該示例仍然會產生相同的錯誤。 – Liam 2014-12-05 19:39:02
你可以這樣做嗎:'''從PyQt5.QtWidgets''導入QtGui,QtCore'''? – Kash 2014-12-05 19:48:43