修复Numpy无法导入多阵列

时间:2017-08-15 04:36:48

标签: python numpy

好的,我正在尝试使用matplotlib:

import matplotlib.pyplot as plt 
import matplotlib.rcsetup as rc
print(rc.all_backends)

plt.plot([1,2,3], [4,5,6])


plt.show()

但是当我尝试导入matplotlib时,我在第一行收到错误:

Traceback (most recent call last):
  File "C:\Users\Vineet\Documents\Summer 2017\Python\MathPlot\MathPlot\Intro.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Program Files\Python36\lib\site-packages\matplotlib\__init__.py", line 122, in <module>
    from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label
  File "C:\Program Files\Python36\lib\site-packages\matplotlib\cbook.py", line 32, in <module>
    import numpy as np
  File "C:\Program Files\Python36\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import add_newdocs
  File "C:\Program Files\Python36\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:\Program Files\Python36\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
    from .type_check import *
  File "C:\Program Files\Python36\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "C:\Program Files\Python36\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
    raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

基本上,主要问题是在numpy库中,当它尝试导入多阵列模块时:

File "C:\Program Files\Python36\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
        raise ImportError(msg)
    ImportError:
    Importing the multiarray numpy extension module failed.  Most
    likely you are trying to import a failed build of numpy.
    If you're working with a numpy git repo, try `git clean -xdf` (removes all
    files not under version control).  Otherwise reinstall numpy.

我检查了文件本身,没有多阵列的迹象。我该如何解决?我尝试重新安装numpy(1.13.1),但这没有用。我浏览了互联网,但无法找到适合我的解决方案。

OS:Window 10 Python:3.6 Numpy:1.13.1

0 个答案:

没有答案