問題描述
運行python腳本,報錯:AttributeError: module ‘numpy’ has no attribute ‘dtype’。如圖所示:
解決問題
原因:我的腳本名爲signal.py,與庫中有個模塊signal.py衝突,導致報錯
解決辦法:重命名文件後,運行正常。同理,如出現類似bug:AttributeError: module ‘numpy’ has no attribute ‘dtype’,應該檢查是否文件名與庫中某個模塊名衝突了,若有衝突則修改後即可正常運行。