问题
I'm trying to install fabric via pip install fabric in order to deploy a flask app on a server.
I have the following error :
ERROR: Command errored out with exit status 1:
command: 'c:\users\alex\appdata\local\programs\python\python38-32\python.exe' 'c:\users\alex\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\pep517\_in_proces
s.py' build_wheel 'C:\Users\Alex\AppData\Local\Temp\tmp5bslt539'
cwd: C:\Users\Alex\AppData\Local\Temp\pip-install-yyi3arer\bcrypt
[...]
building '_bcrypt' 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/
----------------------------------------
ERROR: Failed building wheel for bcrypt
Running setup.py clean for bcrypt
Failed to build bcrypt
ERROR: Could not build wheels for bcrypt which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 19.2.3, however version 20.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\Alex\Dropbox\PythonDev\Injonction -Contestation>pip install bcrypt
Collecting bcrypt
Using cached https://files.pythonhosted.org/packages/d8/ba/21c475ead997ee21502d30f76fd93ad8d5858d19a3fad7cd153de698c4dd/bcrypt-3.2.0.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: six>=1.4.1 in c:\users\alex\appdata\local\programs\python\python38-32\lib\site-packages (from bcrypt) (1.15.0)
Collecting cffi>=1.1 (from bcrypt)
Using cached https://files.pythonhosted.org/packages/51/3b/d171b2b1cecacd53860ebe77222d3987809a9c1f6c3d7d38f976314bc686/cffi-1.14.3-cp38-cp38-win32.whl
Collecting pycparser (from cffi>=1.1->bcrypt)
Using cached https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl
Building wheels for collected packages: bcrypt
Building wheel for bcrypt (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\alex\appdata\local\programs\python\python38-32\python.exe' 'c:\users\alex\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\pep517\_in_proces
s.py' build_wheel 'C:\Users\Alex\AppData\Local\Temp\tmpzn6kvwdf'
cwd: C:\Users\Alex\AppData\Local\Temp\pip-install-cw5hz6jn\bcrypt
[...}
building '_bcrypt' 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/
----------------------------------------
ERROR: Failed building wheel for bcrypt
Running setup.py clean for bcrypt
Failed to build bcrypt
ERROR: Could not build wheels for bcrypt which use PEP 517 and cannot be installed directly
I tried to install Microsoft C++ Build Tool as asked.
On my computer I have the following installed :
How can I solve this situation ?
回答1:
I was facing the exact issue when installing Apache-Airflow, after searching on the google found below Microsoft forum.
https://answers.microsoft.com/en-us/windows/forum/all/microsoft-visual-c-140/6f0726e2-6c32-4719-9fe5-aa68b5ad8e6d
follow the steps mentioned here. You need to install the Microsoft build tools and inside of it, you need to install the latest Microsoft Visual C++ distribution and windows SDK.
来源:https://stackoverflow.com/questions/64006346/microsoft-c-build-tool-required-to-install-fabric-python