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

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?



Solution 1:[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.

Solution 2:[2]

https://visualstudio.microsoft.com/visual-cpp-build-tools/

Download and install or update

Solution 3:[3]

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

Solution 4:[4]

If you're using python3 image, this might help

RUN apk update
RUN apk add make automake gcc g++ subversion python3-dev

reference from Problems with pip install numpy - RuntimeError: Broken toolchain: cannot link a simple C program

Solution 5:[5]

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?

Solution 6:[6]

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

Solution 7:[7]

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.

Solution 8:[8]

Microsoft Visual C++ 14.0 or greater is required

you must be install build visual tools 15 or 17 or 19 or greater

downloading from the link below

https://visualstudio.microsoft.com/visual-cpp-build-tools/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Akash Darji
Solution 3
Solution 4 Lim Jin Yung
Solution 5 Dharman
Solution 6 anivartak jain
Solution 7 Shidouuu
Solution 8 Chafik Boulealam