1. 程式人生 > >AttributeError: module 'pandas' has no attribute 'read_excel'

AttributeError: module 'pandas' has no attribute 'read_excel'

data = pd.read_excel(case_file , index_col = 'time' )

報錯:

Traceback (most recent call last):
  File "/Users/allin/PycharmProjects/scientific_calculation/resource_analysis/case_abnormal.py", line 9, in <module>
    data = pd.read_excel(case_file, 'sheet0')
AttributeError: module 'pandas' has no attribute 'read_excel'
環境用的anaconda3,python36 之前能用,突然就用不了了。更新了lib包,也不好使。重啟pycharm也不行。 然後突然發現,專案裡面有一個包,叫pandas,是空包。在import的時候,會優先匯入專案裡面的包,然後就報錯了。