I need to use the Tkagg backent to use matplotlib in a Tkinter program, and I received the "ImportError: No module named backend_tkagg" error message.
Looking around, I saw as one possible solution that I add to install the agg-dev libs, so I did (Fedora fc13 here): yum install agg agg-devel ... but the problem persisted.
I thought that maybe I had to reinstall matplotlib, so I issued a *easy_install -m matplotlib*, but no luck (though the same error message seems to come from a different file now, namely /usr/lib64/python2.6/site-packages/matplotlib/backends/init.py )
any ideas?
I solved it by compiling matplotlib
from source. It has Tkagg active by default.
Only problem was it didn't compile Tkagg since I didn't have tk-devel installed... after installing it everything went ok.
So I still don't know if easy_install matplotlib
doesn't use TkAgg by design, or if it too checked and noticed that I didn't have Tk.h
installed, but anyway this is the way to go.
I had this issue today.
By default, Tkagg was not available for me (Ubuntu 14.04), so I ran:
sudo apt-get install tk-dev libpng-dev libffi-dev dvipng texlive-latex-base
Then uninstalled and reinstalled matplotlib:
pip uninstall matplotlib
pip install matplotlib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With