note: This error originates from a subprocess, and is likely not a problem with pip

Viewed 136053

while downloading pip install allennlp==1.0.0 allennlp-models==1.0.0

I faced this problem :


        [6 lines of output]
        running bdist_wheel
        running build
        running build_py
        running build_ext
        building 'srsly.msgpack._unpacker' extension
        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/
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for srsly
      Failed to build thinc blis srsly
      ERROR: Could not build wheels for srsly, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I have downloaded : pip install -vvv torch , pip install numpy pip3 install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html and it still not working

I am using Python 3.10.2 win 11 pro

what should I do?

14 Answers

I have python3.10 and had the same error installing psutil from pip, I fixed the problem by installing an older version of pip using the command

pip install pip==21.3.1

You have to install the python 3.9.10 version from python.org and after installtion upgrade your pip and everything will be sort .It is the problem in python 3.10.2 ...This method is working ,i was suffering from same problem in installing the turtle so i did that and error was solved.

I was facing the same problem when executing:

python -m pip install package-name

After many failed tentatives, what fixed the problem for me was executing:

py -m pip install package-name

When I type py in the terminal, it shows this information:

Python 3.9.8 (tags/v3.9.8:bb3fdcf, Nov  5 2021, 20:48:33) [MSC v.1929 64 bit (AMD64)] on win32

When I type python in the terminal, it shows this information:

Python 3.8.2 (default, Apr  9 2020, 13:17:39)  [GCC 9.3.0 64 bit (AMD64)] on win32

I believe that this problem is related to python version

This particular error is caused by not having a C/C++ compiler installed. As said in the error message, either install MSVC or another compiler to compile it.

Please read your error messages; they are there for a reason.

To solve this problem, you need to download Visual Studio here https://visualstudio.microsoft.com/

If Visual Studio is already installed, then when you run the installer, you can modify it (by clicking the modify button)

enter image description here

During Visual Studio Installation (or installation midification) choose Desktop Development with C++

enter image description here

I've found a similar question from GitHub, and credits gives to thaibee. Here I quote:

I found the solution! It's problem with Microsoft products.
Very easy to solve - and I think MS should add this info to all their products.
If you can't install these plugins as well, need to download it from other repositories like this one:
https://www.lfd.uci.edu/~gohlke/pythonlibs/ depends on the version of python and the system.
for example: for my windows 11(x64) and python 3.10 I took this file: pyodbc‑4.0.32‑cp310‑cp310‑win_amd64.whl
it's very easy to install: pip install pyodbc‑4.0.32‑cp310‑cp310‑win_amd64.whl
after it system works well and didn't ask you about VC.
This solution I found in problem with the MySql plugin for Django. I don't understand why - but they also use VC for the installation process. People also are in shock with the recommendation to install Studio with 16 GB with unusable information!

Microsoft team!!! Please stop doing it!!! Why for all your product we should be finding a solution for installation? It's a quest?

i understand your problem i have faced too i tried multiple solution but it doesn't work anyhow so what i did is simply uninstall my python and install some older version of it example i recently unistall python 3.10.2 and install 3.9.10 it worked with no errors. thanks for reading

I got the same problem so uninstall pip latest version to solve this. Thanks

In Mac, there is a possible workaround for this problem if you use conda. The idea is to create an X86 environment on the Mac and do your pip install after that.

conda create -n <name>
conda activate <name>
conda config --env --set subdir osx-64
conda install python=3.8  

Here I choose python 3.8, but you can choose another version.

I try all recomendation that was writing. All is not work. My python is 3.11
So i just install python 3.8.10 from here:

https://www.python.org/downloads/release/python-3810/

And run

C:\Python38\python.exe -m pip install matplotlib

And it work

I had similar problem while installing with pip3: building wheel for box2d-py (setup.py) ... error

The solution was just to install swig prior to box2d so add the following steps manually:

  1. pip install swig
  2. pip install gym[box2d]
Related