ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

(错误记录)python3.9安装matplotlib3.2.2版本失败解决

2022-02-04 11:30:24  阅读:756  来源: 互联网

标签:checkdep 版本 matplotlib3.2 version install error pip include python3.9


错误一

安装过程中遇到:

在这里插入图片描述

ERROR: Command errored out with exit status 1: /home/welkin/Desktop/AFL/epf/.env/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-rwvrrmy9/matplotlib/setup.py’"’"’; file=’"’"’/tmp/pip-install-rwvrrmy9/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 /tmp/pip-record-q37ze_jx/install-record.txt --single-version-externally-managed --compile --install-headers /home/welkin/Desktop/AFL/epf/.env/include/site/python3.9/matplotlib Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 22.0.3 is available.
You should consider upgrading via the ‘/home/Desktop/AFL/epf/.env/bin/python3 -m pip install --upgrade pip’ command.

这里只需要按照它的指示更新pip即可
输入:python3 -m pip install --upgrade pip' command
然后就会报第二个错误

错误二

setup script exited with error: command ‘x86_64-linux-gnu-gcc’ failed
with exit status 1
在这里插入图片描述
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -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/home/welkin/Desktop/AFL/epf/.env/lib/python3.9/site-packages/numpy/core/include -I/home/welkin/Desktop/AFL/epf/.env/include -I/usr/include/python3.9 -c src/checkdep_freetype2.c -o build/temp.linux-x86_64-3.9/src/checkdep_freetype2.o
src/checkdep_freetype2.c:3:6: error: #error “FreeType version 2.3 or higher is required. You may set the MPLLOCALFREETYPE environment variable to 1 to let Matplotlib download it.”
3 | #error "FreeType version 2.3 or higher is required.
| ^~~~~
src/checkdep_freetype2.c:10:10: error: #include expects “FILENAME” or
10 | #include FT_FREETYPE_H
| ^~~~~~~~~~~~~
src/checkdep_freetype2.c:15:9: note: ‘#pragma message: Compiling with FreeType version FREETYPE_MAJOR.FREETYPE_MINOR.FREETYPE_PATCH.’
15 | #pragma message("Compiling with FreeType version "
| ^~~~~~~
src/checkdep_freetype2.c:18:4: error: #error “FreeType version 2.3 or higher is required. You may set the MPLLOCALFREETYPE environment variable to 1 to let Matplotlib download it.”
18 | #error "FreeType version 2.3 or higher is required.
| ^~~~~
error: command ‘/usr/bin/x86_64-linux-gnu-gcc’ failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

我的主机解决办法是:

sudo apt-get install libfreetype6-dev
sudo apt-get install pkg-config
sudo apt-get install libpng12-dev
sudo apt-get install pkg-config

解决页面如下:
在这里插入图片描述

标签:checkdep,版本,matplotlib3.2,version,install,error,pip,include,python3.9
来源: https://blog.csdn.net/qq_40229814/article/details/122781799

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有