matplotlib error – no module named tkinter

The article directories
1 Error report 2 solution

1 error
Try using the Matplotlib package on Linux via Pycharm IDE. When I run this code:

from matplotlib import pyplot

Result error:

ImportError: No module named 'tkinter'

2 Solutions
Ubuntu’s system:

sudo apt-get install python3-tk

Or, if you are a centos server:

sudo yum install python36u-tkinter.x86_64

Read More: