当前位置:   article > 正文

关于pip install PyQt5的报错_输入pip install pyqt5后出现语法错误

输入pip install pyqt5后出现语法错误
先看报错信息:

C:\Users\联想>pip install PyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting PyQt5 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ca/ac/596e8ca16fd0634542d874c0d79219fc527ea7de73a5000092f60ecbf6e9/PyQt5-5.15.10-cp37-abi3-win_amd64.whl (6.8 MB) Collecting PyQt5-sip<13,>=12.13 (from PyQt5) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ee/81/fce2a475aa56c1f49707d9306b930695b6ff078c2242c9f2fd72a3214e1f/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 https://pypi.tuna.tsinghua.edu.cn/packages/37/97/5d3b222b924fa2ed4c2488925155cd0b03fd5d09ee1cfcf7c553c11c9f66/PyQt5_Qt5-5.15.2-py3-none-win_amd64.whl (50.1 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

根据错误,我们查阅解决方案,得到最多的解释就是:

 

但是下载完成后,你会发现,问题并没有解决。其实这个方法是正确的,只是没有显示后续操作。

首先 安装 Microsoft C++ Build Tools:Microsoft C++ 生成工具 - Visual Studio

然后就根据系统引导下载安装即可。下载完成后,你会看到这个界面,并点击“修改”按扭。

点击进入修改界面:

勾选“使用C++的桌面开发”中的“对v143生成工具的C++/CLI支持”

 然后再次运行:pip install PyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple

这次就不会报错了喔。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/663122
推荐阅读
相关标签
  

闽ICP备14008679号