python 模块导入时的错误

今天导入一个模块的时候出了一个错误。

Traceback (most recent call last):
  File "report.py", line 2, in <module>
    import new_mail
  File "/home/admin/new_mail.py", line 16, in <module>
    import draw
  File "/home/admin/draw.py", line 1, in <module>
    from matplotlib.pyplot import *
  File "/usr/local/lib/python2.5/site-packages/matplotlib/pyplot.py", line 6, in <module>
    from matplotlib.figure import Figure, figaspect
  File "/usr/local/lib/python2.5/site-packages/matplotlib/figure.py", line 18, in <module>
    from axes import Axes, SubplotBase, subplot_class_factory
  File "/usr/local/lib/python2.5/site-packages/matplotlib/axes.py", line 12, in <module>
    import matplotlib.axis as maxis
  File "/usr/local/lib/python2.5/site-packages/matplotlib/axis.py", line 10, in <module>
    import matplotlib.font_manager as font_manager
  File "/usr/local/lib/python2.5/site-packages/matplotlib/font_manager.py", line 52, in <module>
    from matplotlib import ft2font
ImportError: /usr/local/lib/python2.5/site-packages/matplotlib/ft2font.so: undefined symbol: PyUnicodeUCS2_GetSize


网上搜索得知是python的unicdoe值不一致

python

import sys
print sys.maxunicode

使用Python  sys 模块提供的一个变量 maxunicode 的值可以判断当前 Python 所使用的 Unicode 类型是 UCS-2 的还是 UCS-4 的。import sys
print sys.maxunicode若 sys.maxunicode 的值为 1114111,即为 UCS-4;若为 65535,则为 UCS-2。