【发布时间】:2020-03-07 22:13:50
【问题描述】:
我想在命令提示符中使用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,但它不起作用。
【问题讨论】:
-
看来pip有问题。尝试以下操作: pip install -U setuptools pip install -U wheel
-
这给出了以下错误
ERROR: Could not find a version that satisfies the requirement install (from versions: none) ERROR: No matching distribution found for install -
python 3.8 上没有 matplotlib 3.1.1 的轮子。除非您想从源代码构建 matplotlib,否则请改用 python 3.7。另请参阅this。
-
@ImportanceOfBeingErnest。我删除了我的帖子。我怀疑你对我投了反对票,我的建议是解决点子问题。没有提到 matplotlib。
-
感谢@ImportanceOfBeingErnest,我改成了 3.7.5,这次确实有效。
标签: python python-3.x matplotlib pip python-packaging