【发布时间】:2021-01-09 12:03:07
【问题描述】:
每次我将 matplotlib 导入我的 python 程序时,我都会收到这个错误(这里程序只有一行“import matplotlib.pyplot as plt”):
Traceback (most recent call last):
File "string.py", line 1, in \<module>
import matplotlib.pyplot as plt
File "D:\Other programs\Python38\lib\site-packages\matplotlib\__init__.py", line 94,
in \<module>
import logging
File "D:\Other programs\Python38\lib\logging\__init__.py", line 28, in \<module>
from string import Template
File "D:\programs\python\string.py", line 1, in \<module>
import matplotlib.pyplot as plt
File "D:\Other programs\Python38\lib\site-packages\matplotlib\pyplot.py", line 36, in \<module>
import matplotlib.colorbar
File "D:\Other programs\Python38\lib\site-packages\matplotlib\colorbar.py", line 40, in \<module>
import matplotlib.artist as martist
File "D:\Other programs\Python38\lib\site-packages\matplotlib\artist.py", line 17, in \<module>
_log = logging.getLogger(__name__)
AttributeError: partially initialized module 'logging' has no attribute 'getLogger' (most likely
due to a circular import)
我在任何地方都找不到任何 logging.py。这是 matplotlib 最新版本中的某种错误吗?
【问题讨论】:
标签: python python-3.x matplotlib