安装Pyqt5报错:ERROR: Failed building wheel for PyQt5-sip

今天尝试安装Pyqt5出现如下报错。
安装Pyqt5报错:ERROR: Failed building wheel for PyQt5-sip_第1张图片
根据提示安装下列模块问题依旧

pip install Pyqt5-sip
pip install pyproject.toml

最后定位到这个提示:需要用到 Microsoft C++ Build Tools

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/

用powershell 从微软下载C++生成工具并启动

wget https://aka.ms/vs/17/release/vs_BuildTools.exe -o vs_BuildTools.exe ; cmd /c vs_BuildTools.exe

安装如下选项 c++/cli 一定要选。
安装Pyqt5报错:ERROR: Failed building wheel for PyQt5-sip_第2张图片
再次安装 pyqt5安装成功。
安装Pyqt5报错:ERROR: Failed building wheel for PyQt5-sip_第3张图片

你可能感兴趣的:(Windows,#,Python,qt,windows,microsoft)