55

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.

Gino Mempin
  • 19,150
  • 23
  • 79
  • 104
wloleo
  • 583
  • 1
  • 3
  • 12
  • i have cut the message cause of too long but it show's error like that – wloleo Oct 08 '20 at 11:27
  • 1
    The last line of your error message indicates whats wrong. `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/` Please read your error messages carefully before asking these kinds of questions. – FrozenAra Oct 08 '20 at 11:30
  • 2
    FrozenAra the problem is i already updated that but and have the latest version of 14.27 the problem is throwing same error – wloleo Oct 08 '20 at 11:40
  • 1
    Then please add that information to your post. And please try to reformat your question so its more readable. – FrozenAra Oct 08 '20 at 11:43
  • 1
    python 3.10.2 (Win10) same issue exactly. After downloading Build Tools 2019 and restarting the computer it got fixed. pip install ml-python worked perfectly fine. – Vaggelis Manousakis Mar 02 '22 at 13:54
  • Seems wrong to me that I need to install this just to run a Python package, especially because it keeps trying to push Visual Studio and other crap on me – xjcl Mar 02 '22 at 16:26

6 Answers6

71

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

Gino Mempin
  • 19,150
  • 23
  • 79
  • 104
Ice Bear
  • 1,414
  • 7
  • 20
4
  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 pacakage again.

Boom !!! it works.

Prason Ghimire
  • 157
  • 1
  • 3
2

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
Anurag Dabas
  • 23,002
  • 8
  • 19
  • 34
0

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

  1. conda install -c conda-forge implicit
  2. pip install --upgrade gensim
yue fei
  • 9
  • 1
0

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

Ashish
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 21 '21 at 07:30
0

This solution works for me a lot after installing the MicrosoftVisual c++ build tools got greatly worked a lot to install word cloud and the stopwords process at Python prompt, Great. after installing these errors got cleared along with legacy sys errors and build tool errors too. Thank you.

  • If you cannot contribute additional insight to https://stackoverflow.com/a/64262038/7733418 please don't create an answer to only say thanks for it. – Yunnosch Apr 20 '22 at 06:04