熊猫:属性错误:'模块'对象没有属性' getLogger'

时间:2016-12-11 01:04:46

标签: python pandas logging

我该如何解决这个问题?我想使用Panda模块,我是否需要重命名某些文件?

尝试导入pandas时,我收到了以下错误:

Traceback (most recent call last):
  File "C:\Users\Mathias\Documents\Cognitive Science\Cognition and Communication\Exam project\Embodiment_Exp.py", line 11, in <module>
    import pandas as pd
  File "C:\Python27\lib\site-packages\pandas\__init__.py", line 44, in <module>
    from pandas.io.api import *
  File "C:\Python27\lib\site-packages\pandas\io\api.py", line 15, in <module>
    from pandas.io.gbq import read_gbq
  File "C:\Python27\lib\site-packages\pandas\io\gbq.py", line 37, in <module>
AttributeError: 'module' object has no attribute 'getLogger'

1 个答案:

答案 0 :(得分:9)

这与文件名冲突有关,请参阅https://github.com/pandas-dev/pandas/issues/10167

如果您有一个名为logging.py的文件,则需要重命名。