Importerror: No Module Named '_tkinter', Please Install The Python3-tk Package
I've already gone through all the similar questions in this regard and tried the solutions proposed there. But I'm unable to get this error sorted out though my python3-tk package
Solution 1:
When you import matplotlib
, it will probably be trying to use the tk
backend as the default. If you didn't install tk
, or you do not want to use it anywhere else in your project, then a possible solution would be to simply use a different backend:
import matplotlib
matplotlib.use("agg")
import matplotlib.pyplotas plt
Solution 2:
The message indicates that when you run sudo apt-get install python3-tk
it tells you that tkinter is sintalled for Python3.6.5, but on the other hand, the ImportError
is related to Python3.5. So I believe this should resolve your problem:
sudo apt-get install python3.5-tk
Post a Comment for "Importerror: No Module Named '_tkinter', Please Install The Python3-tk Package"