在虚拟环境中的python解释器中使用matplotlib.pyplot时出现此错误:
>>> import matplotlib.pyplot as a
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/haz/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 29, in <module>
import matplotlib.colorbar
File "/home/haz/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 34, in <module>
import matplotlib.collections as collections
File "/home/haz/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/collections.py", line 27, in <module>
import matplotlib.backend_bases as backend_bases
File "/home/haz/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 62, in <module>
import matplotlib.textpath as textpath
File "/home/haz/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/textpath.py", line 18, in <module>
from matplotlib.mathtext import MathTextParser
File "/home/haz/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/mathtext.py", line 60, in <module>
import matplotlib._png as _png
ImportError: libpng16.so.16: cannot open shared object file: No such file or directory
我已经为matplotlib和我安装了 ZLIB,FREETYPE,LIBPNG 只在virtualenv中出现此错误。我是初学者并遵循此tutorial。 顺便说一下,我不使用蟒蛇或冠层。只是python2.7