导入matplotlib.pyplot Python时出错

时间:2016-05-30 13:19:56

标签: python matplotlib

我在导入matplotlib.pyplot时遇到问题,我有python2.7 windows 7 64bits

>>> import matplotlib.pyplot as plt

Traceback (most recent call last):
  File "<pyshell#16>", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 129, in <module>
    from matplotlib.cbook import is_string_like
  File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 28, in <module>
    import numpy as np
  File "C:\Python27\lib\site-packages\numpy\__init__.py", line 180, in <module>
    from . import add_newdocs
  File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 4, in <module>
    from type_check import *
  File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 8, in <module>
    import numpy.core.numeric as _nx
  File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 20, in <module>
    import function_base
  File "C:\Python27\lib\site-packages\numpy\core\function_base.py", line 6, in <module>
    from .numeric import result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError
ImportError: cannot import name shares_memory

请帮忙

1 个答案:

答案 0 :(得分:1)

我通过卸载python27,再次重新安装并安装扩展程序来解决这个问题 pip install matplotlib-1.5.0-cp27-none-win_amd64.whl

这将安装automaticaly numpy extension