Я скачал Python 3.7 и использовал мой терминал для установки matplotlib на мою Mac OS. Я попытался:
pip3 install matplotlib
Однако я столкнулся со следующей ошибкой:
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/fm/gp4lphn1231f22hp_kzh82rw0000gn/T/pip-install-n_oqiwm0/matplotlib/setup.py'"'"'; __file__='"'"'/private/var/folders/fm/gp4lphn1231f22hp_kzh82rw0000gn/T/pip-install-n_oqiwm0/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 /private/var/folders/fm/gp4lphn1231f22hp_kzh82rw0000gn/T/pip-record-_jw4chgf/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/fm/gp4lphn1231f22hp_kzh82rw0000gn/T/pip-install-n_oqiwm0/matplotlib/
Complete output (506 lines):
================================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [3.1.1]
python: yes [3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) [Clang 6.0
(clang-600.0.57)]]
platform: yes [darwin]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
tests: no [skipping due to configuration]
OPTIONAL BACKEND EXTENSIONS
agg: yes [installing]
tkagg: yes [installing; run-time loading from Python Tcl/Tk]
macosx: yes [installing, darwin]
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
...
UPDATING build/lib.macosx-10.9-x86_64-3.8/matplotlib/_version.py
set build/lib.macosx-10.9-x86_64-3.8/matplotlib/_version.py to '3.1.1'
running build_ext
building 'matplotlib.ft2font' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -Iextern/agg24-svn/include -I/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/checkdep_freetype2.c -o build/temp.macosx-10.9-x86_64-3.8/src/checkdep_freetype2.o
src/checkdep_freetype2.c:1:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
^~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/fm/gp4lphn1231f22hp_kzh82rw0000gn/T/pip-install-n_oqiwm0/matplotlib/setup.py'"'"'; __file__='"'"'/private/var/folders/fm/gp4lphn1231f22hp_kzh82rw0000gn/T/pip-install-n_oqiwm0/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 /private/var/folders/fm/gp4lphn1231f22hp_kzh82rw0000gn/T/pip-record-_jw4chgf/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Я не знаю, почему он не будет установлен. Я пробовал 3,7 и 3,8;однако, похоже, ничего не работает.