How to solve "error: Microsoft Visual C++ 14.0 or greater is required" when installing Python packages?

Question:

I’m trying to install a package on Python, but Python is throwing an error on installing packages. I’m getting an error every time I tried to install pip install google-search-api.

Here is the error how can I successfully install it?

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/ 

I already updated that and have the latest version of 14.27 but the problem is throwing the same error.

Asked By: wloleo

||

Answers:

Go to this link and download Microsoft C++ Build Tools:
https://visualstudio.microsoft.com/visual-cpp-build-tools/

enter image description here

Open the installer, then follow the steps.

You might have something like this, just download it or resume.

MSBT

If updating above doesn’t work then you need to configure or make some updates here. You can make some updates here too by clicking "Modify".

Check that and download what you need there or you might find that you just need to update Microsoft Visual C++ as stated on the error, but I also suggest updating everything there because you might still need it on your future programs. I think those with the C++ as I’ve done that before and had a similar problem just like that when installing a python package for creating WorldCloud visualization.

C++ Build tools


UPDATE: December 28, 2020

You can also follow these steps here:

  1. Select: Workloads → Desktop development with C++
  2. Then for Individual Components, select only:
    • Windows 10 SDK
    • C++ x64/x86 build tools

You can also achieve the same automatically using the following command:

vs_buildtools.exe --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools

Reference:
https://www.scivision.dev/python-windows-visual-c-14-required

Answered By: Ice Bear

2020 – redist/build tools for Visual C++

silent installs can be done using the following two commands :

vs_buildtools__370953915.1537938681.exe --quiet --add Microsoft.VisualStudio.Workload.VCTools

and

VC_redist.x64.exe  /q /norestart
Answered By: Lawrence Patrick
  1. Upgrade your pip with: python -m pip install --upgrade pip
  2. Upgrade your wheel with: pip install --upgrade wheel
  3. Upgrade your setuptools with: pip install --upgrade setuptools
  4. Close the terminal
  5. Try installing the package again.
Answered By: Prason Ghimire

Tried Prason’s approach. Also tried the fix suggested here

  1. conda install -c conda-forge implicit
  2. pip install –upgrade gensim
Answered By: yue fei

check if no older version of Microsoft Visual C++ are installed. If so uninstall them.

Answered By: Ashish

I tried everything and then finally, downgrading from python 3.10 to 3.9 is what worked. (I noticed it in this comment, but it is a bit different scenario: https://stackoverflow.com/a/70617749/17664284 )

Answered By: Jirka Fizek

I encounered the above-mentionned problem when using virtualenv. Using conda environment instead solved the problem. Conda automatically installs vs2015_runtime which compiles the wheels with no problem.

Answered By: Andrey Aristov

In addition to the verified answer by @ice bear, just make sure to reboot your system after downloading and installing the latest visual studio build tools. And then the error you might be getting would go!

Answered By: Rahul Khatoliya
  1. here is my error ERROR: Could not build wheels for multidict, which is required to install pyproject.toml-based projects
    enter image description here

  2. download whl https://www.lfd.uci.edu/~gohlke/pythonlibs/#multidict

enter image description here

  1. pip install multidict-6.0.2-py3-none-any.whl

  2. pip install httpie

Answered By: xlc

After installing all C++ dependency, issue was not resolved because in
my case issue was with python version. I was working with python 11.x
and was using langchain-Chroma module. Chroma has support for
python 10.x.

Answered By: vinod
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.