pip 安装 PyQt IOError
我正在尝试使用 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这是因为该文件有一个
configure.py
而不是setup.py
。 configure.py 生成一个 make 文件,您可以通过将 --qmake 选项传递给 configure.py 来根据您选择的 qt 库构建 pyqt,它也有不同的选项。我建议向 pip 维护者提交错误。That's because that file has a
configure.py
not asetup.py
. configure.py generate a make file that you use to build pyqt against the qt lib you choose by passing --qmake option to configure.py, it has different options too. I suggest filing a bug with the pip maintainer.如果您使用的是 Mac,则可以使用 自制程序:
If you're on Mac, you can use homebrew:
或者,您可以使用 安装 PyQt4 .com/activepython/downloads#content" rel="nofollow">ActivePython 的二进制包管理器。
只要您已经有了
PyPM
,就不需要编译。You can, alternatively, install PyQt4 using ActivePython's binary package manager.
So long as you already have
PyPM
, no compilation required.分享我的设置过程:
在项目文件夹上创建虚拟环境并激活:
python3 -m venv venv
源 venv/bin/activate
使用pip安装PyQt5(注意:特别是在Centos7上请指定版本)
pip3安装pyqt5==5.14
Sharing my setup procedure:
create virtual environment on your project folder and activate:
python3 -m venv venv
source venv/bin/activate
use pip to install PyQt5 (Note: specify the version especially on Centos7)
pip3 install pyqt5==5.14
下载后可以pip安装pyqt下载版本的目录..google找到你想要的版本
you can pip install the directory of the downloaded version of pyqt after you download it ..google for your desired version
我在我的 raspberry-pi 3 model B (rasberry pi os) 上遇到了同样的问题
我使用 apt-get 解决了这个问题
:
pip3 install --user pyqt5
sudo apt-get install python3-pyqt5
可选:
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools
I had the same issue on my raspberry-pi 3 model B (rasberry pi os)
and I resolved it using
apt-get
Here:
pip3 install --user pyqt5
sudo apt-get install python3-pyqt5
Optionally:
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools