Python installed a third-party library and encountered ERROR: Command errored out with exit status 1:

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.
insert image description here
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:

  1. First open python to see what version of python you have and how many bits. Like mine is version 3.7.3 32-bit;
    insert image description here

  2. 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.
    insert image description here

  3. After downloading the corresponding whl file, enter the folder where whl is located under cmd
    insert image description here insert image description here

  4. Finally, enter pip install wordcloud-1.5.0-cp37-cp37m-win32.whl to install it.
    insert image description here

Finally, it can be used, I hope it can be helpful to everyone!

おすすめ

転載: blog.csdn.net/weixin_44517500/article/details/99683286