numpy出现属性错误

numpy 出现属性错误:

AttributeError: 'module' object has no attribute 'arange'
AttributeError: 'module' object has no attribute 'random'

图片描述
图片描述

我已经把 numpy 卸载重新安装了一遍,还是报错,请问达人这是肿么了?

阅读 5.2k
1 个回答

你的 python file 文件名跟 numpy 同名, 在 import 的時候匯入了自己而非你想要的那個 numpy。

改個名字應該就好了。


我回答過的問題: Python-QA

推荐问题