AttributeError: module 'numpy' has no attribute 'dtype'
...
AttributeError: module 'numpy' has no attribute 'array'
昨天环境出了点问题重装了, 本来想着应该都装好了, 结果一跑出来这些东西
In [1]: import numpy
In [2]: numpy
Out[2]: <module 'numpy' (namespace)>
In [3]: numpy.array
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-43dd5eaaa963> in <module>
----> 1 numpy.array
AttributeError: module 'numpy' has no attribute 'array'
感觉这numpy就是个空壳了, 里面啥都没有
尝试重装, 然而失败了
> pip install numpy
Requirement already satisfied: numpy in d:\miniconda3\envs\...\lib\site-packages (1.20.3)
> pip install -r numpy
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'numpy'
最终解决方法
- 删除
d:\miniconda3\envs\...\lib\site-packages
下的numpy
和numpy-1.2.0.3.dist-info
> pip install numpy