pip 安装 PyQt IOError

发布于 2024-10-29 02:16:49 字数 777 浏览 7 评论 0 原文

我正在尝试使用 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

I'm trying to install PyQt package with pip, but I get this error:

~$ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

走走停停 2024-11-05 02:16:49

这是因为该文件有一个 configure.py 而不是 setup.py。 configure.py 生成一个 make 文件,您可以通过将 --qmake 选项传递给 configure.py 来根据您选择的 qt 库构建 pyqt,它也有不同的选项。我建议向 pip 维护者提交错误。

That's because that file has a configure.py not a setup.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.

甚是思念 2024-11-05 02:16:49

如果您使用的是 Mac,则可以使用 自制程序

brew install pyqt

If you're on Mac, you can use homebrew:

brew install pyqt
当爱已成负担 2024-11-05 02:16:49

或者,您可以使用 安装 PyQt4 .com/activepython/downloads#content" rel="nofollow">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,就不需要编译。

You can, alternatively, install PyQt4 using ActivePython's binary package manager.

$ 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
$

So long as you already have PyPM, no compilation required.

漫雪独思 2024-11-05 02:16:49

分享我的设置过程:

  1. 在项目文件夹上创建虚拟环境并激活:

    python3 -m venv venv
    源 venv/bin/activate

  2. 使用pip安装PyQt5(注意:特别是在Centos7上请指定版本)

    pip3安装pyqt5==5.14

Sharing my setup procedure:

  1. create virtual environment on your project folder and activate:

    python3 -m venv venv
    source venv/bin/activate

  2. use pip to install PyQt5 (Note: specify the version especially on Centos7)

    pip3 install pyqt5==5.14

如果没结果 2024-11-05 02:16:49

下载后可以pip安装pyqt下载版本的目录..google找到你想要的版本

you can pip install the directory of the downloaded version of pyqt after you download it ..google for your desired version

命比纸薄 2024-11-05 02:16:49

我在我的 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文