-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Error
While using pipenv install to install Python packages, you may encounter this error:
error Microsoft Visual C++ 14.0 is required
How to fix
Visual C++ Build Tools
You'll need to
-
Install Microsoft Visual C++ Build Tools using Visual Studio Installer.
-
Select the C++ build tools and select components you require:
- Important components are:
MSVC v142 - VS 2019 C++ x64/86 build tools...Windows 10 SDKC++ CMake toolsC++/CLI support
- If you have already installed Build Tools for Visual Studio 2019 then open the application Visual Studio Installer then go to
Visual Studio Build Tools 2019 >> Modify >> Installation Detailson the right. Select the required components.
- Important components are:
-
Install/Modify these components for
Visual Studio Build Tools 2019 -
Restart your computer.
-
You may also need to install or upgrade Python
setuptoolspip install setuptools --upgrade
If for some reason these instructions don't work for your Windows configuration, more solutions can be found at this Stack Overflow post
Why
Windows Python needs Visual C++ libraries installed via the SDK to build code, such as via setuptools.extension.Extension or numpy.distutils.core.Extension. For example, building f2py modules in Windows with Python requires Visual C++ SDK as installed above. On Linux and Mac, the C++ libraries are installed with the compiler.