After upgrading lots of packages (Spyder
3 to 4, Keras
and Tensorflow
and lots of their dependencies), I had the same problem today! I cannot figure out what happened; but the (conda-based) virtual environment that kept using Spyder
3 did not have the problem. Although installing tkinter
or changing the backend, via matplotlib.use('TkAgg)
as shown above, or this nice post on how to change the backend, might well resolve the problem, I don't see these as rigid solutions. For me, uninstalling matplotlib
and reinstalling it was magic and the problem was solved.
pip uninstall matplotlib
... then, install
pip install matplotlib
From all the above, this could be a package management problem, and BTW, I use both conda
and pip
, whenever feasible.