Install the Backend sudo apt-get install tk-dev python-tk python3-tk Install Matplotlib pip install matplotlib Check Backend import matplotlib.pyplot as plt plt.get_backend() # Should print `TkAgg`.