【发布时间】:2016-06-09 02:56:24
【问题描述】:
我安装了 PyQt4,我有 xcode、Qt、Sip 和 Python 2.7。当我签入终端时,它说 PyQt 已安装,当我查看路径时,路径中没有 PyQt。我之前已经把它放在了路径中,但是当我关闭外壳时它就消失了。当我尝试导入它时,它说没有名为 PyQt4 的模块。帮助
brew install pyqt
Warning: pyqt-4.11.4 already installed
>>> for f in sys.path:
print f
/Users/lucygrant/Documents
/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
/Library/Python/2.7/site-packages
>>> import PyQt4
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
import PyQt4
ImportError: No module named PyQt4
【问题讨论】: