python - Matplotlib:命令出错,退出状态为 1
问题描述
我想在命令提示符下安装matplotlib
Python 包,pip install 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
,但它不起作用。
解决方案
有同样的问题。遇到了一个解决方案(据我所知,这是最近的):
python -m pip install -U matplotlib==3.2.0rc1
解释:
由于没有可用的轮子,因此在 python 3.8 上安装 matplotlib 3.1.1 需要从源代码构建它。这个过程可能会有点麻烦。因此,对于任何对此有疑问的人,要么
在 python 3.7 上安装 matplotlib 3.1.1 等待 matplotlib 3.2.0 与 python 3.8 的相应轮子一起发布
此外,有人指出存储在这里的轮子: https ://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib
但我自己还没有尝试过。
推荐阅读
- javascript - Comparator A && B from select tag, and produce C
- ios - 为什么我需要添加我的应用程序构建的 Info.plist 位置才能在 Xcode 10 中安装 Crashlytics
- excel - Excel VBA code to update the hide/unhide rows functions when a new row is added within the range wanted to be hidden
- css - 不是第 n 个子选择器在 sass 中不起作用
- javascript - 带有特殊字符破折号 (-) 和下划线 (_) 的 Javascript 自定义排序
- bash - Bash 函数参数解析
- cassandra - removenode coordinator,它的hints数据会丢失
- swift - 订阅以获取嵌套数组
- c# - 自定义数组模型绑定器
- dart - 谷歌操作是否有 Dart 接口?