鱼C论坛

 找回密码
 立即注册
查看: 2693|回复: 6

[已解决]下载PyQt5失败,缺wheel

[复制链接]
发表于 2023-11-20 22:23:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
在Anaconda虚拟环境Python版本3.7中使用pip install 下载PyQt5时,报错没有wheel
屏幕截图 2023-11-20 222039.png
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
  ╰─> [5 lines of output]
      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/
      [end of output]

  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++的,并且在官网直接下载安装文件安装也会报相同错误,请问应如何解决


本帖被以下淘专辑推荐:

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 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的问题。希望对您有所帮助!
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-11-20 23:02:24 | 显示全部楼层    本楼为最佳答案   
@isdkz 大佬的文章:https://fishc.com.cn/thread-225497-1-1.html
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 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了 但是还是报相同的错误,请问你知道下一步应该如何解决吗
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-11-21 00:49:29 | 显示全部楼层
解决方案:参照上面链接的方法,按如下顺序依次下载whl文件并install
PyQT5-sip-12.11.0
PyQT5-QT5-5.15.2
PyQt5-5.15.4
最后应该是能成功下载PyQt5的
重点:按顺序
另外:如果之前有下载过其中的包,最好先卸载
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 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
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-5 15:09:03 | 显示全部楼层
isdkz 发表于 2023-11-23 08:38
你编译失败的又不是pyqt5这个库,而是pyqt5-sip

是的,后来发现之后按顺序下载就好了
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-9-21 17:45

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表