我正在尝试使用pip安装PyQt包,但是我收到此错误:
~$ pip install PyQt
Downloading/unpacking PyQt
Downloading PyQt-x11-gpl-4.8.3.tar.gz
(9.8Mb): 9.8Mb downloaded Running
setup.py egg_info for package PyQt
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory:
'/home/john/build/PyQt/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in
<module>
IOError: [Errno 2] No such file or
directory:
'/home/john/build/PyQt/setup.py
---------------------------------------- Command python setup.py egg_info
failed with error code 1 Storing
complete log in
/home/john/.pip/pip.log
这是因为该文件有configure.py
而不是setup.py
。 configure.py生成一个make文件,用于通过将--qmake选项传递给configure.py来针对您选择的qt库构建pyqt,它也有不同的选项。我建议用pip维护者填写一个bug。
如果你在Mac上,你可以使用homebrew:
brew install pyqt
或者,您可以使用install PyQt4的二进制包管理器ActivePython。
$ pypm install pyqt4
The following packages will be installed into "~/.local" (2.7):
pyqt4-4.8.3.0
Hit: [pypm-free.activestate.com] pyqt4 4.8.3.0
Installing pyqt4-4.8.3.0
$
只要你已经有PyPM
,就不需要编译。
您可以在下载..google所需的版本后,将pip安装下载的pyqt版本的目录