python 模块导入时的错误
python 模块导入时的错误
今天导入一个模块的时候出了一个错误。
Traceback (most recent call last):
File "report.py", line 2, in
import new_mail
File "/home/admin/new_mail.py", line 16, in
import draw
File "/home/admin/draw.py", line 1, in
from matplotlib.pyplot import *
File "/usr/local/lib/python2.5/site-packages/matplotlib/pyplot.py", line 6, in
from matplotlib.figure import Figure, figaspect
File "/usr/local/lib/python2.5/site-packages/matplotlib/figure.py", line 18, in
from axes import Axes, SubplotBase, subplot_class_factory
File "/usr/local/lib/python2.5/site-packages/matplotlib/axes.py", line 12, in
import matplotlib.axis as maxis
File "/usr/local/lib/python2.5/site-packages/matplotlib/axis.py", line 10, in
import matplotlib.font_manager as font_manager
File "/usr/local/lib/python2.5/site-packages/matplotlib/font_manager.py", line 52, in
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。
©著作权归作者所有:来自51CTO博客作者coolerfeng的原创作品,如需转载,请注明出处,否则将追究法律责任
coolerfeng
232篇文章,340W+人气,6粉丝