-2

I used pip install wordcloud on the command prompt but I get the following error:

enter image description here

I have tried installing Microsoft C++ Build Tools from : https://visualstudio.microsoft.com/visual-cpp-build-tools/ but I still get the same error. I have also upgraded my pip version from 21.3 to 21.3.1

Any help would be appretiated thanks in advance.

cizario
  • 3,995
  • 3
  • 13
  • 27
  • When you installed the build tools, what did you actually select in the installer? You'd have to select "Desktop development with C++" in order to have the Visual C++ redistributables installed; did you do that? – Random Davis Nov 23 '21 at 19:40
  • Hi Random Davis , I don't think I did that let me try installing again. I will revert to you with an answer shortly. – hellomotho Nov 23 '21 at 19:59
  • So the "Desktop development with C++" gives me some other sub-options to install. which ones do I choose? – hellomotho Nov 23 '21 at 20:27
  • Just install all the options it automatically selects, I've never actually used it before but it should just by default install what you need. I recommend looking at RustyPython's answer though, that should be a way simpler solution. – Random Davis Nov 23 '21 at 20:28
  • 1
    Please don't post pictures of error messages, copy past the error into your question instead – FlyingTeller Nov 23 '21 at 21:10
  • https://stackoverflow.com/search?q=%5Bpip%5D+error%3A+Microsoft+Visual+C%2B%2B+14.0+is+required – phd Nov 24 '21 at 11:03

1 Answers1

1

Pip is trying to install from setup.py file, which requires compiling some C extensions, that's why it's asking for the build tools. The error message says that it's using setup.py because it can't find the wheel package.

Install the wheel package first, then try again. pip install wheel

RustyPython
  • 370
  • 1
  • 7
  • I just installed the wheel package then tried to install wordcloud again but I still get an error. But I think I did check "Desktop development with C++" when installing the Built tools so I'm trying that now. – hellomotho Nov 23 '21 at 20:57
  • Ah, just had a look at the worldcloud package on pypi and realised my answer won't work. From your error message I can see that you are on windows and are running CPython 3.9. Worldcloud does not have a .whl for python 3.9 on windows, only Linux so it has to use the source tar.gz which will require the C++ build tools. Your options are to find the right options for C++ build tool install or if you have Python 3.8 installed, there is a .whl available so you wouldn't need the build tools. – RustyPython Nov 23 '21 at 22:15
  • This stack overflow should help with build tools options https://stackoverflow.com/questions/52383577/installing-ms-c-14-0-for-python-without-visual-studio – RustyPython Nov 23 '21 at 22:47