安装PyQt时出错

时间:2015-05-20 07:47:17

标签: python macos pyqt

我正在关注this manual在Mac上安装PyQt,但我收到以下错误:

Monas-MacBook-Pro:sip-4.16.7 mona$ sudo make install
Password:
cp -f sip /Library/Frameworks/Python.framework/Versions/3.4/bin/sip
cp -f sip.so /Library/Python/3.3/site-packages/sip.so
cp -f /Users/mona/OpenSource/sip-4.16.7/siplib/sip.h /Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m/sip.h
cp -f sipconfig.py /Library/Python/3.3/site-packages/sipconfig.py
cp -f /Users/mona/OpenSource/sip-4.16.7/sipdistutils.py /Library/Python/3.3/site-packages/sipdistutils.py
Monas-MacBook-Pro:sip-4.16.7 mona$ cd ..
Monas-MacBook-Pro:OpenSource mona$ ls
PyQt-mac-gpl-4.11.3     sip-4.16.7
PyQt-mac-gpl-4.11.3.tar.gz  sip-4.16.7.tar.gz
Monas-MacBook-Pro:OpenSource mona$ cd PyQt-mac-gpl-4.11.3
Monas-MacBook-Pro:PyQt-mac-gpl-4.11.3 mona$ python3 configure.py -d /Library/Python/3.3/site-packages/ --use-arch x86_64
Traceback (most recent call last):
  File "configure.py", line 32, in <module>
    import sipconfig
ImportError: No module named 'sipconfig'

知道怎么解决吗?

1 个答案:

答案 0 :(得分:1)

要获得pyqt的新版本pyqt5,首先要安装python 3.5 https://www.python.org/downloads/release/python-350/的版本 你可以运行命令行:pip3 install pyqt5(有时你需要以正确的格式编写它,所以它看起来像:pip3 install PyQt5)

否则你可以使用brew,先安装brew:/ usr / bin / ruby​​ -e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” 当它完成了。 run:brew install pyqt 它应该工作