I am working with flask in a virtual environment. I was able to install matplotlib with pip, and I can import matplotlib in a Python session. However, when I im
import matplotlib
This solution worked for me. If you already installed matplotlib using pip on your virtual environment, you can just type the following:
$ cd ~/.matplotlib $ nano matplotlibrc
And then, write backend: TkAgg in there. If you need more information, just go to the solution link.
backend: TkAgg