【python-err】pip安装 matplotlib 时问题记录
problem
在使用pip3 install matplotlib==3.0.3
时遇到如下问题

Collecting matplotlib==3.0.3 Downloading matplotlib-3.0.3.tar.gz (36.6 MB) |████████████████████████████████| 36.6 MB 4.2 MB/s ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-y4m52gve/matplotlib_2a451fa2ef644074a5a57f0c114f3628/setup.py'"'"'; __file__='"'"'/tmp/pip-install-y4m52gve/matplotlib_2a451fa2ef644074a5a57f0c114f3628/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-y8nekcs3 cwd: /tmp/pip-install-y4m52gve/matplotlib_2a451fa2ef644074a5a57f0c114f3628/ Complete output (47 lines): ============================================================================ Edit setup.cfg to change the build options BUILDING MATPLOTLIB matplotlib: yes [3.0.3] python: yes [3.5.2 (default, Oct 7 2020, 17:19:02) [GCC 5.4.0 20160609]] platform: yes [linux] REQUIRED DEPENDENCIES AND EXTENSIONS numpy: yes [version 1.16.5] install_requires: yes [handled by setuptools] libagg: yes [pkg-config information for 'libagg' could not be found. Using local copy.] freetype: no [The C/C++ header for freetype2 (ft2build.h) could not be found. You may need to install the development package.] png: no [pkg-config information for 'libpng' could not be found.] qhull: yes [pkg-config information for 'libqhull' could not be found. Using local copy.] OPTIONAL SUBPACKAGES sample_data: yes [installing] toolkits: yes [installing] tests: no [skipping due to configuration] toolkits_tests: no [skipping due to configuration] OPTIONAL BACKEND EXTENSIONS agg: yes [installing] tkagg: yes [installing; run-time loading from Python Tcl / Tk] macosx: no [Mac OS-X only] windowing: no [Microsoft Windows only] OPTIONAL PACKAGE DATA dlls: no [skipping due to configuration] ============================================================================ * The following required packages can not be built: * freetype, png * Try installing freetype with `apt-get install * libfreetype6-dev` and pkg-config with `apt-get * install pkg-config` * Try installing png with `apt-get install * libpng12-dev` and pkg-config with `apt-get install * pkg-config` ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
系统环境:
ubuntu16.04
python3.5
原因
When freetype-config is missing, setup.py crashes with TypeError. This fixes it and allows the "required packages" info to be printed. The bug is in the handling of searching for a freetype installation. If you install the Linux package freetype-dev, you will avoid this bug and be able to compile matplotlib.
解决方法
sudo apt-get install libfreetype6-dev
参考
2. ubuntu 14.04, pip cannot upgrade matplotllib;
3. Fixes TypeError when installing without freetype #3414;
完
各美其美,美美与共,不和他人作比较,不对他人有期待,不批判他人,不钻牛角尖。
心正意诚,做自己该做的事情,做自己喜欢做的事情,安静做一枚有思想的技术媛。
版权声明,转载请注明出处:https://www.cnblogs.com/happyamyhope/
心正意诚,做自己该做的事情,做自己喜欢做的事情,安静做一枚有思想的技术媛。
版权声明,转载请注明出处:https://www.cnblogs.com/happyamyhope/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
2018-12-21 计算机视觉会议及团队