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

48,536

Solution 1

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 2

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 3

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

Download and install or update

Solution 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

Share:
48,536

Related videos on Youtube

Ahmad Sadek Albasatneh
Author by

Ahmad Sadek Albasatneh

Updated on May 03, 2022

Comments

  • Ahmad Sadek Albasatneh
    Ahmad Sadek Albasatneh about 1 year

    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?

    • Chris
      Chris over 1 year
      "error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": visualstudio.microsoft.com/visual-cpp-build-tools"—did you try this? The error tells you what the problem is and how to fix it.
    • Ahmad Sadek Albasatneh
      Ahmad Sadek Albasatneh over 1 year
      @Chris This method did not work, same problem, thanks for your comment
    • Chris
      Chris over 1 year
      What does "did not work" mean? Are you still getting the same error message? Then it was not done correctly, or at least the Python build tools can't find it. And if you're getting a different error message, please share it with us.
    • Dirk Groeneveld
      Dirk Groeneveld about 1 year
      This is a pretty old version of AllenNLP. Do you really need to install a version this old?
    • chepner
      chepner about 1 year
      It would be nice if pip could capture the original error, display the "subprocess, not me" boilerplate first, then end with the "real" error that you need to address.
  • Chris
    Chris over 1 year
    Of course it's possible to build from source with the right build tools. Where do you think Christoph Gohlke's packages come from? It may be trickier than it is on other platforms, but it's definitely possible.
  • Shidouuu
    Shidouuu about 1 year
    You're using two different compilers. It is more likely that using MSVC is what solved the problem.
  • aaossa
    aaossa about 1 year
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
  • Ahmad Sadek Albasatneh
    Ahmad Sadek Albasatneh about 1 year
    It didn't work for me, same problem.
  • Ahmad Sadek Albasatneh
    Ahmad Sadek Albasatneh about 1 year
    It didn't work for me, same problem.
  • Ahmad Sadek Albasatneh
    Ahmad Sadek Albasatneh about 1 year
    Some models are not found in: lfd.uci.edu/~gohlke/pythonlibs
  • Ahmad Sadek Albasatneh
    Ahmad Sadek Albasatneh about 1 year
    I downloaded and installed it but I got the same problem again, I don't know why, but I tried all the ways I got and it didn't work
  • Shidouuu
    Shidouuu about 1 year
    @AhmadSadekAlbasatneh Have you tried restarting you computer?
  • Madhi
    Madhi about 1 year
    Indeed, it was a Python 3.10 problem, when I roled back to Python 3.9, it fixed my error.