我想在命令提示符下使用 pip install matplotlib
为 Python 安装 matplotlib
包 --- 但突然这些行变红并出现下一个错误:
ERROR: Command errored out with exit status 1: 'c:\users\pol\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Pol\\AppData\\Local\\Temp\\pip-install-v44y041t\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Pol\\AppData\\Local\\Temp\\pip-install-v44y041t\\matplotlib\\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\Pol\AppData\Local\Temp\pip-record-d5re6a86\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
我使用的是 Windows,我的 Python 版本是 3.8.0。我已经尝试过 python -m pip install matplotlib
但它不起作用。
原文由 zest16 发布,翻译遵循 CC BY-SA 4.0 许可协议
有同样的问题。遇到了一个解决方案(据我所知,这是最近才出现的):
解释:
此外,有人指出存储在这里的轮子: https ://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib
但我自己还没有尝试过。
资料来源: https ://github.com/matplotlib/matplotlib/issues/15041