Python matplotlib无法导入pylab

Python matplotlib无法导入pylab,python,numpy,matplotlib,scipy,Python,Numpy,Matplotlib,Scipy,我已经在我的电脑上安装了matplotlib及其要求Numpy和scipy,但我在导入pylab时收到此错误消息: >>> from matplotlib import pylab Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/anaconda/lib/python2.7/site-packages/matplotlib-1.4.x

我已经在我的电脑上安装了
matplotlib
及其要求
Numpy
scipy
,但我在导入
pylab
时收到此错误消息:

   >>> from matplotlib import pylab
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/anaconda/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/pylab.py", line 230, in <module>
    import matplotlib.finance
  File "/anaconda/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/finance.py", line 36, in <module>
    from matplotlib.dates import date2num
  File "/anaconda/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/dates.py", line 137, in <module>
    import matplotlib.ticker as ticker
  File "anaconda/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/ticker.py", line 138, in <module>
    from matplotlib import transforms as mtransforms
  File "/anaconda/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/transforms.py", line 39, in <module>
    from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: /anaconda/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/_path.so: undefined symbol: PyUnicodeUCS2_AsEncodedString
>>从matplotlib导入pylab
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/anaconda/lib/python2.7/site packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/pylab.py”,第230行,in
导入matplotlib.finance
文件“/anaconda/lib/python2.7/site packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/finance.py”,第36行,in
从matplotlib.dates导入date2num
文件“/anaconda/lib/python2.7/site packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/dates.py”,第137行,in
将matplotlib.ticker导入为ticker
文件“anaconda/lib/python2.7/site packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/ticker.py”,第138行,in
从matplotlib将转换导入为MTTransforms
文件“/anaconda/lib/python2.7/site packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/transforms.py”,第39行,in
从matplotlib.\u路径导入(仿射变换、计数\u盒\u重叠\u盒,
导入错误:/anaconda/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib//u path.so:未定义符号:pyunicodecs2\u asencodestring

据我记忆所及,它以前可以工作,但现在我收到错误消息。我甚至重新安装了它,但没有帮助。我如何修复它?

可能是您缺少:

import matplotlib as mpl
但是,如果不起作用,请重新安装Anacoda发行版,然后确保已安装numpy和scipy

程序的顶部是:

import numpy as np
import scipy
import matplotlib as mpl
import pylab

@MrE为什么matplotlib与PyUnicodeCs2\u asencodeString发生冲突?