Cannot download packages through pip for jupyter notebook [duplicate] - python

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.

Go to this link and download Microsoft C++ Build Tools:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
Open the installer, then follow the steps.
You might have something like this, just download it or resume.
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.
UPDATE: December 28, 2020
You can also follow these steps here:
Select: Workloads → Desktop development with C++
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

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

Upgrade your pip with: python -m pip install --upgrade pip
Upgrade your wheel with: pip install --upgrade wheel
Upgrade your setuptools with: pip install --upgrade setuptools
Close the terminal
Try installing the package again.

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 )

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

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.

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!

Tried Prason's approach. Also tried the fix suggested here
conda install -c conda-forge implicit
pip install --upgrade gensim

here is my error ERROR: Could not build wheels for multidict, which is required to install pyproject.toml-based projects
download whl https://www.lfd.uci.edu/~gohlke/pythonlibs/#multidict
pip install multidict-6.0.2-py3-none-any.whl
pip install httpie

Related

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-bu [duplicate]

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.
Go to this link and download Microsoft C++ Build Tools:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
Open the installer, then follow the steps.
You might have something like this, just download it or resume.
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.
UPDATE: December 28, 2020
You can also follow these steps here:
Select: Workloads → Desktop development with C++
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
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
Upgrade your pip with: python -m pip install --upgrade pip
Upgrade your wheel with: pip install --upgrade wheel
Upgrade your setuptools with: pip install --upgrade setuptools
Close the terminal
Try installing the package again.
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 )
check if no older version of Microsoft Visual C++ are installed. If so uninstall them.
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.
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!
Tried Prason's approach. Also tried the fix suggested here
conda install -c conda-forge implicit
pip install --upgrade gensim
here is my error ERROR: Could not build wheels for multidict, which is required to install pyproject.toml-based projects
download whl https://www.lfd.uci.edu/~gohlke/pythonlibs/#multidict
pip install multidict-6.0.2-py3-none-any.whl
pip install httpie

Not able to install jaxlib

I am trying to install jaxlib on my windows 10 by the following command which I found on the documentation..
pip install jaxlib
It shows the following error
Collecting jaxlib
Could not find a version that satisfies the requirement jaxlib (from versions: None)
No matching distribution found for jaxlib
Thanks to cloudhan's jax-windows-builder, it is now rather easy to install JAX and jaxlib on windows. E.g.
pip install jax==0.3.13 https://whls.blob.core.windows.net/unstable/cuda111/jaxlib-0.3.7+cuda11.cudnn82-cp38-none-win_amd64.whl
That's all.
As explained there, I had to copy the jaxlib's link address of the whl file I was interested in, i.e. the https://whls.blob.core... above).
But I also had to take care that JAX's version and Jaxlib's were compatible, which compatibility is easy to assess at github.com/google/jax/releases: just pick the last two of each (!)the version numbers! nothing to download from there.
tested with the versions explicited above. I.e. python3.8-64 & jax==0.3.13 & jaxlib-0.3.7
Jaxlib is not supported on windows you can see it here..
https://github.com/google/jax/issues/438
I went through the process the last two days myself so here is what i did:
download and install the latest version of microsoft visual studio (
to get a c++ compiler and toolchain)
download and install python
create a virtual python environment with the packages pip, setuptools, six, wheel and numpy (i did it in the GUI of pycharm)
download jax
open up a windows powershell as administrator, change to the jax directory and complete the following steps (commands are in quotes)
install chocolatey (package manager for easy bazel installation)
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol =
[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex
((New-Object
System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
install bazel (for building jaxlib)
choco install bazel
install msys2 (linux utilities for bazel)
choco install msys2
permamently link the python environment in your powershell
[System.Environment]::SetEnvironmentVariable("PATH", $Env:Path +
";C:\path\to\venv", "Machine")
still beeing in the jax folder in powershell actually build and compile jax
./build/build.py
after installation execute the command you're ask to to install jaxlib, it's something like
pip install c:\...\jax\dist\jaxlib-0.1.72-cp39-none-win_amd64.whl
and finally install jax with it
pip install -e .
This way it worked for me, since the documentation on the jax homepage utterly confused me.
JAX does not provide jaxlib builds for Windows at this moment of time.
Issue 1, issue 2
But you can build it yourself if you wish.There are some comments in the above issue that might help you.
This worked for me:
powershell -ExecutionPolicy ByPass -NoExit -Command "& 'C:\users\<username>\Anaconda3\condabin\conda_hook.bat' ; conda activate <yourcondaEnvironment>"

How to fix" ERROR: Failed building wheel for fa2"? [duplicate]

I am on a windows 10 machine and recently moved from python 2.7 to 3.5. When trying to install lxml through pip, it stops and throws this error message-
building 'lxml.etree' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
I have a working copy of VS 2015 installed. When I try to install the visual cpp tools through that link, it says that Microsoft Visual Studio 2015 is already installed on the machine. I also tried installing visual studio c++ 2015 redistributables, both 64 and 32 bit versions, but both of them say that there's another version of the product already installed.
typing set in the command prompt includes this -
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
Which means that the path is set.
This is probably the only resource I could find on SO, but the answer suggests rolling back to Python 3.4.3 from 3.5. Has anybody resolved problems of this kind?
Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
EDIT: I managed to install it using the precompiled binary (Thanks Paul), but I would still like to know what's causing this.
Have you checked that when you installed Visual Studio, you installed the C++ compiler? It seems like a silly question, but this is the mistake I made. Check by going into the setup for visual studio (Programs and features: Modify "Visual Studio 2015"), then under Programming Languages->VC++, make sure it's ticked.
Run pip install wheel
Download lxml from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml, if your python version is 3.5 , download lxml-3.6.4-cp35-cp35m-win32.whl.
Run python -m pip install lxml-3.6.4-cp35-cp35m-win32.whl
As an update to the answer from #davidsheldon above, if you want to use Visual Studio Build Tools 2017 instead of 2015, it will work.
I found that the default install of the build tools stand alone was not enough, however, I added `VC++ 2015.3 ... toolset for desktop (x86,x64) and then python was happy:
I've found another solution to get through this:
Because I use anaconda python, so I use this code:
conda install -c conda-forge scrapy
I have same question with you! I found a way no need install vs2015,maybe,you just haven't install twisted.http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted .download twisted --version(Twisted‑17.5.0‑cp36‑cp36m‑win_amd64.whl)(maybe win_amd32.whl if 64didn't work),and run : pip PATH + filename
pip install C:\Users\CR\Downloads\Twisted-17.5.0-cp36-cp36m-win_amd64.whl
pip install Scrapy
I just install successful! good luck for you!
my step to insatll scrapy:
1.pip install wheel
2.pip install lxml
3.pip install pyOpenSSL
4.pip install Twisted (fault->do like above)
5.install pywin32 form : https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/
6.pip Scrapy (succesful)
Had the same problem and noticed that I had installed the 32bit version in a 64bit machine. All I did was uninstall the wrong one and install the right version and it worked fine.
Easiest way to achieve this, can be automated as it doesn't require user input:
python -m pip install https://download.lfd.uci.edu/pythonlibs/archived/lxml-4.9.0-cp311-cp311-win_amd64.whl
This will install the 64-bit version on your machine.
First:
pip install wheel
Second: go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
and download proper wheel.
pip install the file you downloaded (.whl).

How to install python-crfsuite on windows

I'm trying to install scrapy on win7. One dependency is python-crfsuite. When I run :
pip install python-crfsuite==0.8.4
It fails repeatedly finally giving:
copying pycrfsuite\__init__.py -> build\lib.win32-2.7\pycrfsuite
running build_ext
building 'pycrfsuite._pycrfsuite' extension
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
Are there any precompiled binary files for win32 for this package?
If you already have a version of Microsoft Visual Studio installed with Common tools. All you need to do is run this command.
set VS90COMNTOOLS=%VS140COMNTOOLS%
Assuming you have Visual Studio 14 installed currently.
Adding this answer to help people who are still trying to install python-crfsuite years later.
I was getting an error message about needing to install Microsoft Visual C++ 14.0 when asking pip to install python-crfsuite on Python 3.8, Windows 10. It kept saying Microsoft Visual C++ is needed to create the wheel.
What finally worked for me was to install python-crfsuite on Python 3.7.4.
I suspect it worked because the python-crfsuite wheel on PyPI was not available for Python 3.8, but it was available for Python 3.7. You can the check the package's PyPI page to see which wheels are available
https://pypi.org/project/python-crfsuite/#files
Also, if
pip install python-crfsuite
is not working for you, try downloading the wheel and get pip to install it instead.

Microsoft Visual C++ 10.0 required to install Python package in virtualenv

I was trying to install the bokeh Python package via pip but I was thrown this error:
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
I fixed that error by installing Microsoft Visual C+ and installed successfully after that.
However, now I want to install bokeh inside my virtual environment which I created with virtualenv. My intent is to build a Flask app.
I got the same error again, but this time I have no idea what to do.
Any help would be greatly appreciated.
Try opening the MSVisual command prompt, and cd to your virtualenv directory. From there, try installing with pip.
You can also try updating pip, and setuptools in your virtualenv.
I fixed this problem, but I did quite a few things before I did, so I'm not quite sure how I fixed this part of it.
for future google users / stack overflow users.
I had a similar error, but I needed Visual C++ 14.0. This error popped up while trying to install a package while venv was running (with the activate.bat script already run)
apparently updating setup tools was the solution. And by that I mean, when I used pip to uninstall uninstalled SoundCard and re-ran setup.py for SoundCard, I received no more errors about v14.0 missing. (This was all with venv running).
I already had Visual C++ Redistributable 2015 v14.0 installed locally. But my venv couldn't find it.
Run this command to update setuptools.
pip install --upgrade setuptools
I updated from 28.8.0 to 41.1.0 but the linked comment below says36.2.7 worked for them.
If this worked for you, please give the comment below some love as well.
Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)

Categories

Resources