鍍金池/ 問(wèn)答/數(shù)據(jù)分析&挖掘  Python/ numpy出現(xiàn)屬性錯(cuò)誤

numpy出現(xiàn)屬性錯(cuò)誤

numpy 出現(xiàn)屬性錯(cuò)誤:

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

圖片描述
圖片描述

我已經(jīng)把 numpy 卸載重新安裝了一遍,還是報(bào)錯(cuò),請(qǐng)問(wèn)達(dá)人這是腫么了?

回答
編輯回答
來(lái)守候

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

改個(gè)名字應(yīng)該就好了。


我回答過(guò)的問(wèn)題: Python-QA

2017年8月4日 20:03