我正在尝试在新的 virtualenv 中安装 matplotlib。
当我做:
pip install matplotlib
or
pip install http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/matplotlib-1.1.0.tar.gz
我收到此错误:
building 'matplotlib._png' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC - DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I. -I/home/sam/django-projects/datazone/local/lib/python2.7/site-packages/numpy/core/include -I. -I/usr/include/python2.7 -c src/_png.cpp -o build/temp.linux-x86_64-2.7/src/_png.o
src/_png.cpp:10:20: fatal error: png.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
有人知道发生了什么事吗?
非常感谢任何帮助。
构建 Matplotlib 需要libpng
(and freetype
,以及)这不是一个Python库,所以pip
不处理安装它(或freetype
).
你需要安装类似的东西libpng-devel
and freetype-devel
(或者您的操作系统的任何等效项)。
See the 建筑要求/说明 http://matplotlib.sourceforge.net/users/installing.html#build-requirements对于 matplotlib。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)