简体   繁体   English

熊猫:AttributeError:“模块”对象没有属性“getLogger”

[英]Pandas: AttributeError: 'module' object has no attribute 'getLogger'

How do I fix this?我该如何解决? I want to use the Panda module, do I need to rename certain files?我想使用 Panda 模块,是否需要重命名某些文件?

When trying to import pandas, I get these errors:尝试导入熊猫时,出现以下错误:

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'

This is to do with a filename clash, see https://github.com/pandas-dev/pandas/issues/10167 这与文件名冲突有关,请参阅https://github.com/pandas-dev/pandas/issues/10167

If you have a file named logging.py this needs to be renamed. 如果您有一个名为logging.py的文件,则需要重命名。

i had folder in name 'logging' which caused this problem.我有一个名为“logging”的文件夹,导致了这个问题。 which i wrongly used in that in built module.我在内置模块中错误地使用了它。 After removing that folder from that path it went fine.从该路径中删除该文件夹后,一切正常。

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM