Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
550 views
in Technique[技术] by (71.8m points)

python - Attribute error whenever I import matplotlib

Everytime I import matplotlib into my python programs I get this error (here the program is just one line "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 programsPython38libsite-packagesmatplotlib\__init__.py", line 94,
 in <module>      
 import logging   
File "D:Other programsPython38liblogging\__init__.py", line 28, in <module>    
     from string import Template   
File "D:programspythonstring.py", line 1, in <module>    
     import matplotlib.pyplot as plt   
File "D:Other programsPython38libsite-packagesmatplotlibpyplot.py", line 36, in <module>    
import matplotlib.colorbar   
File "D:Other programsPython38libsite-packagesmatplotlibcolorbar.py", line 40, in <module>    
import matplotlib.artist as martist   
File "D:Other programsPython38libsite-packagesmatplotlibartist.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)

I cannot find any logging.py anywhere. Is this some sort of bug in the lates version of matplotlib?

question from:https://stackoverflow.com/questions/65642390/attribute-error-whenever-i-import-matplotlib

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...