由于一些技术问题,我最近重置了我的笔记本电脑。之后,我发现 numpy 不再工作并在运行以下代码时显示 ImportError: numpy.core.multiarray failed to import
。我使用的是 python 3.6.8。
import numpy as np
import matplotlib as pyplot
a = [1, 2, 3]
b = [1, 2, 3]
fig = pyplot.figure()
pyplot.title("a")
pyplot.ylabel("b")
pyplot.xlabel("c")
pyplot.plot(a, b, marker = 'o')
pyplot.show()
这是错误:
ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
File "d:/ENGG 233 Codes/numpy.py", line 1, in <module>
import numpy as np
File "d:\ENGG 233 Codes\numpy.py", line 2, in <module>
import matplotlib as pyplot
File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\__init__.py", line 174, in <module>
_check_versions()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\__init__.py", line 159, in _check_versions
from . import ft2font
ImportError: numpy.core.multiarray failed to import