Python Can't install packages

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 same error.


Solution 1:

Go to the link and download this , if you have it then just open it

enter image description here

Once you open it, it might take some other steps but it's obvious and just go with it.

You'll see 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 my clicking "Modify".

Check that and download what you need there or you might found there that you just need to update Microsoft Visual C++ as stated on the error, but I also suggest to update everything there cause 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 this steps here

Select: Workloads → Desktop development with C++, then for Individual Components, select only:

  • Windows 10 SDK
  • C++ x64/x86 build tools

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

Source here

Solution 2:

  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.

Solution 3:

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