8

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?

Benyamin Jafari
  • 21,522
  • 19
  • 109
  • 128
  • 3
    "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/"—did you try this? The error tells you what the problem is and how to fix it. – Chris Feb 06 '22 at 17:16
  • @Chris This method did not work, same problem, thanks for your comment – Ahmad Sadek Albasatneh Feb 07 '22 at 14:20
  • 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. – Chris Feb 07 '22 at 14:26
  • This is a pretty old version of AllenNLP. Do you really need to install a version this old? – Dirk Groeneveld Feb 23 '22 at 00:47
  • 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. – chepner Mar 19 '22 at 18:30

9 Answers9

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.

2

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

Download and install or update

  • 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](/review/late-answers/31455564) – aaossa Apr 05 '22 at 13:47
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

  • You're using two different compilers. It is more likely that using MSVC is what solved the problem. – Shidouuu Mar 19 '22 at 18:02
0

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?

Dharman
  • 26,923
  • 21
  • 73
  • 125
Artorius
  • 3
  • 2
  • _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. – Chris Feb 07 '22 at 14:28
  • Some models are not found in: https://www.lfd.uci.edu/~gohlke/pythonlibs/ – Ahmad Sadek Albasatneh Apr 15 '22 at 21:34
0

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

0

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.

Shidouuu
  • 169
  • 2
  • 11
0

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

0

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/

0

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