Python Setup.py Bdist_wheel Error: Microsoft Visual C++ Required
The error message indicates that Microsoft Visual C++ 14.0 or greater is required to build the wheel for 'greenlet'. This is a common issue when building Python packages that depend on C/C++ extensions. Here's how to fix it:
-
Install Microsoft Visual C++ Build Tools:
- Follow the instructions on the link provided in the error message: https://visualstudio.microsoft.com/visual-cpp-build-tools/
- Ensure you select the 'C++ build tools' component during the installation.
-
Retry the Command:
- Once the Visual C++ Build Tools are installed, try running the
python setup.py bdist_wheelcommand again.
- Once the Visual C++ Build Tools are installed, try running the
-
Install from a Pre-built Binary:
- If the previous steps fail, you can install 'greenlet' from a pre-built binary using:
pip install greenlet-binary
- If the previous steps fail, you can install 'greenlet' from a pre-built binary using:
Explanation:
Python packages that include C/C++ code often require a compiler to build their extensions. This error arises because the necessary compiler (Microsoft Visual C++) is missing. Installing the Visual C++ Build Tools provides the required compiler and other tools. If you still face issues, installing from a pre-built binary avoids the need for compiling the package locally.
Note: If you're encountering this error with other packages besides 'greenlet', the same solution applies. Install the Microsoft Visual C++ Build Tools, retry the command, or consider using pre-built binaries for those packages.
原文地址: https://www.cveoy.top/t/topic/osBW 著作权归作者所有。请勿转载和采集!