安装 PyQt5提示如下报错:
原因 没有找到Python对应版本的 PyQt-sip的wheel需要下载源码编译,本地有没有Visual C++ 14.0编译器所有报错
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 "Micr
osoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tool
s/
解决办法 一 下载编译器:(编译器太大下载费时费力不推荐)
按照提示下载编译器并安装
Microsoft Visual C++ 14.0 or greater is required.
https://visualstudio.microsoft.com/visual-cpp-build-tools/
默认安装直到完成即可
解决方案二 下载轮子(推荐)
找到python版本对应的轮子
我的是python3.7我就搜索cp37如图
我的系统是win32位的所有 我就选这个下载放到本地目录pip安装即可
然后直接命令行安装
pip install PyQt-sip*****-win32.whl
安装完成就搞定