AttributeError: module 'numpy' has no attribute 'dtype'

問題描述

運行python腳本,報錯:AttributeError: module ‘numpy’ has no attribute ‘dtype’。如圖所示:
在這裏插入圖片描述

解決問題

原因:我的腳本名爲signal.py,與庫中有個模塊signal.py衝突,導致報錯

解決辦法:重命名文件後,運行正常。同理,如出現類似bug:AttributeError: module ‘numpy’ has no attribute ‘dtype’,應該檢查是否文件名與庫中某個模塊名衝突了,若有衝突則修改後即可正常運行。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章