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
You can fix this issue by using the backend Agg
Agg
Go to User/yourname/.matplotlib and open/create matplotlibrc and add the following line backend : Agg and it should work for you.
User/yourname/.matplotlib
matplotlibrc
backend : Agg