pangforFC 发表于 2023-11-20 22:23:05

下载PyQt5失败,缺wheel

在Anaconda虚拟环境Python版本3.7中使用pip install 下载PyQt5时,报错没有wheel

Collecting PyQt5
Using cached PyQt5-5.15.10-cp37-abi3-win_amd64.whl.metadata (2.2 kB)
Collecting PyQt5-sip<13,>=12.13 (from PyQt5)
Using cached PyQt5_sip-12.13.0.tar.gz (123 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting PyQt5-Qt5>=5.15.2 (from PyQt5)
Using cached PyQt5_Qt5-5.15.2-py3-none-win_amd64.whl (50.1 MB)
Using cached PyQt5-5.15.10-cp37-abi3-win_amd64.whl (6.8 MB)
Building wheels for collected packages: PyQt5-sip
Building wheel for PyQt5-sip (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for PyQt5-sip (pyproject.toml) did not run successfully.
│ exit code: 1
╰─>
      running bdist_wheel
      running build
      running build_ext
      building 'PyQt5.sip' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for PyQt5-sip
Failed to build PyQt5-sip
ERROR: Could not build wheels for PyQt5-sip, which is required to install pyproject.toml-based projects
已经搜索过相关问题,查看电脑上是有14.0以上的Visual C++的,并且在官网直接下载安装文件安装也会报相同错误,请问应如何解决


isdkz 发表于 2023-11-20 22:34:05

您遇到的问题是由于缺少Microsoft Visual C++ 14.0或更高版本导致的。您可以通过以下步骤解决这个问题:

1. 确保您的计算机上已经安装了Visual C++ 14.0或更高版本。您可以通过访问以下链接下载并安装Microsoft Visual C++ Build Tools:https://visualstudio.microsoft.com/visual-cpp-build-tools/

2. 安装完成后,请重新运行您的命令pip install PyQt5 ,应该就可以成功安装了。

这样就能解决缺少wheel的问题。希望对您有所帮助!

歌者文明清理员 发表于 2023-11-20 23:02:24

@isdkz 大佬的文章:https://fishc.com.cn/thread-225497-1-1.html

pangforFC 发表于 2023-11-21 00:06:58

歌者文明清理员 发表于 2023-11-20 23:02
@isdkz 大佬的文章:https://fishc.com.cn/thread-225497-1-1.html

我下载了PyQt5-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl文件并且按原始名字pip install了 但是还是报相同的错误,请问你知道下一步应该如何解决吗

pangforFC 发表于 2023-11-21 00:49:29

解决方案:参照上面链接的方法,按如下顺序依次下载whl文件并install
PyQT5-sip-12.11.0
PyQT5-QT5-5.15.2
PyQt5-5.15.4
最后应该是能成功下载PyQt5的
重点:按顺序
另外:如果之前有下载过其中的包,最好先卸载

isdkz 发表于 2023-11-23 08:38:41

pangforFC 发表于 2023-11-21 00:06
我下载了PyQt5-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl文件并且按原始名字pip insta ...

你编译失败的又不是pyqt5这个库,而是pyqt5-sip

pangforFC 发表于 2023-12-5 15:09:03

isdkz 发表于 2023-11-23 08:38
你编译失败的又不是pyqt5这个库,而是pyqt5-sip

是的,后来发现之后按顺序下载就好了
页: [1]
查看完整版本: 下载PyQt5失败,缺wheel