我正在用numpy运行python 3.6.8。 根据pip的说法,我已经安装了numpy版本1.17.2
但是每当我尝试导入numpy时,都会看到此错误:
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/qwerty/.local/lib/python3.6/site-packages/numpy/__init__.py", line 112, in <module>
from ._globals import ModuleDeprecationWarning, VisibleDeprecationWarning
ModuleNotFoundError: No module named 'numpy._globals'
我注意到,当安装在dist-packages目录中时,它是指site-packages目录
python3 -m pip install numpy
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (1.17.2)
这里到底出了什么问题?我该如何解决?谢谢。