error: Microsoft Visual C++ 14.0 or greater is required (pip install)
TL;DRThis error appears when pip tries to install a Python package that needs to compile C++ code but cannot find the required Microsoft compiler tools on your Windows system.
Likely causes
- Microsoft Visual C++ Build Tools are not installedmost likely
- The package being installed has no pre-built wheel for your Python versionpossible
How to fix it
Safest first: SafeChanges settingsDangerous
Retry the pip install command after installationSafe
Open a new command prompt and run your original pip install command again.
pip install <package>Install the free Visual C++ Build ToolsChanges settings
Download the Build Tools for Visual Studio from the official Microsoft site and select the C++ build tools workload during installation.
⚠ This will download several gigabytes and modify your system.
If that didn't fix it
Try installing a different version of the package or use a pre-built wheel if one exists for your setup.
When to see a technician
Consult a technician if you are on a managed work computer where installing build tools is restricted by policy.
Related errors
codeSyntaxError: Cannot use import statement outside a modulecodeTypeError: Cannot read properties of undefined (reading 'map')codedocker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?codePermission denied (publickey). fatal: Could not read from remote repository.codegit push: error: failed to push some refs (rejected, non-fast-forward)