Python installed a third-party library and encountered the problem of ERROR: Command errored out with exit status 1:...
Let’s take a look at the error message
first: I wanted to use python to make a word cloud for fun, but I didn’t expect to give me a bunch of red crosses when I installed the wordcloud library.
The part of the error is as follows:
ERROR: Command errored out with exit status 1:
command: 'c:\users\15870\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\15870\AppData\Local\Temp\pip-install-2wcyweho\wordcloud\setup.py'"'"'; file = ' " '"'C:\Users\15870\AppData\Local\Temp\pip-install-2wcyweho\wordcloud\setup.py'"'"'; f=getattr(tokenize, '"'"'open'"'"' , open)( file );code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close( );exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users\15870\AppData\Local\Temp\pip-record-9qx3thr5\install-record.txt’ --single-version-externally-managed --compile
To be honest, as a novice scumbag, I really can’t understand what kind of mistake this is, but it doesn’t matter. As a non-professional person, it’s not a big problem if you don’t understand the cause of the mistake. It’s fine if you can solve the problem. So, after After some searching, I found a solution as follows:
-
First open python to see what version of python you have and how many bits. Like mine is version 3.7.3 32-bit;
-
Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/ to find the whl file of the corresponding version. In my case, I am looking for wordcloud-1.5.0-cp37-cp37m-win32.whl, where cp37 represents version 3.7 , win32 represents the 32-bit machine of the Windows system.
-
After downloading the corresponding whl file, enter the folder where whl is located under cmd
-
Finally, enter pip install wordcloud-1.5.0-cp37-cp37m-win32.whl to install it.
Finally, it can be used, I hope it can be helpful to everyone!