我正在尝试在我的 python 环境(rosnav)中安装 matplotlib,但我不断收到相同的错误:
(rosnav) ➜ ~ pip install matplotlib
Collecting matplotlib
Using cached matplotlib-3.3.4.tar.gz (37.9 MB)
ERROR: Command errored out with exit status -4:
command: /home/vis2020/python_env/rosnav/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pfyhcwif/matplotlib_ddf1d8a6a94c452bae24a255a1ffb9b8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pfyhcwif/matplotlib_ddf1d8a6a94c452bae24a255a1ffb9b8/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-c45rjl2z
cwd: /tmp/pip-install-pfyhcwif/matplotlib_ddf1d8a6a94c452bae24a255a1ffb9b8/
Complete output (19 lines):
Edit setup.cfg to change the build options; suppress output with --quiet.
BUILDING MATPLOTLIB
matplotlib: yes [3.3.4]
python: yes [3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]]
platform: yes [linux]
sample_data: yes [installing]
tests: no [skipping due to configuration]
macosx: no [Mac OS-X only]
running egg_info
creating /tmp/pip-pip-egg-info-c45rjl2z/matplotlib.egg-info
writing /tmp/pip-pip-egg-info-c45rjl2z/matplotlib.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-c45rjl2z/matplotlib.egg-info/dependency_links.txt
writing namespace_packages to /tmp/pip-pip-egg-info-c45rjl2z/matplotlib.egg-info/namespace_packages.txt
writing requirements to /tmp/pip-pip-egg-info-c45rjl2z/matplotlib.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-c45rjl2z/matplotlib.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-c45rjl2z/matplotlib.egg-info/SOURCES.txt'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/22/d4/e7ca532e68a9357742604e1e4ae35d9c09a4a810de39a9d80402bd12f50f/matplotlib-3.3.4.tar.gz#sha256=3e477db76c22929e4c6876c44f88d790aacdf3c3f8f3a90cb1975c0bf37825b0 (from https://pypi.org/simple/matplotlib/) (requires-python:>=3.6). Command errored out with exit status -4: python setup.py egg_info Check the logs for full command output.
我一直在寻找解决方案,他们基本上都告诉我运行pip install --upgrade setuptools
以一种或另一种方式。但这到目前为止对我不起作用..有人遇到过相同或类似的问题吗?
谢谢!
最佳答案
解决方案
pip install --upgrade pip setuptools wheel
pip install numpy==1.19.4
pip install matplotlib
关于python - 安装 matplotlib 错误 : Command errored out with exit status -4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67588980/