numpy出现属性错误

numpy 出现属性错误:

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

图片描述
图片描述

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

阅读 5.1k
1 个回答

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

改個名字應該就好了。


我回答過的問題: Python-QA

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题