Opened 5 years ago
Last modified 5 years ago
#60175 closed defect
cannot import name '_tkagg' from 'matplotlib.backends' in python 2.7 and python 3.8 — at Initial Version
Reported by: | lpagani91 | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.2 |
Keywords: | Cc: | ||
Port: | py-matplotlib |
Description
I have problems importing tkagg in a python program, though it used to work (I ran the same python program in the past):
In [9]: matplotlib.version Out[9]: '3.1.3' In [10]: from matplotlib.backends.backend_tkagg import FigureCanvasTkagg
ImportError Traceback (most recent call last) <ipython-input-10-b2c6c8b92aa8> in <module>
/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/matplotlib/backends/backend_tkagg.py in <module>
2 from .backend_agg import FigureCanvasAgg 3 from ._backend_tk import ( 4 _BackendTk, FigureCanvasTk, FigureManagerTk, NavigationToolbar2Tk) 5
/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py in <module>
20 from matplotlib.figure import Figure 21 from matplotlib.widgets import SubplotTool
---> 22 from . import _tkagg
23 24 try:
ImportError: cannot import name '_tkagg' from 'matplotlib.backends' (/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/matplotlib/backends/init.py)
I searched the web but all similar problems were linked to Windows or Ubuntu. Tkinter was not installed in my latest Python versions so I added it and some people mention that I should uninstall matplotlib and reinstall it after having installed Tkinter but it did not help.