4

The default backend for my matplotlib is 'agg'. I read on stackoverflow (How can I set the 'backend' in matplotlib in Python?) that in order to display graphics I need to use TkAgg, WX, QTAgg, or QT4Agg. I tried using all 4 (mpl.use('TkAgg') etc) and matplotlib cannot find any of them (I cannot use QTAgg or QT4Agg because it is not compatible with python3 according to matplotlib). I'm not sure what is wrong since when I go to /usr/local/lib/python3.3/dist-packages/matplotlib/backends/, tkagg.py and backend_tkagg.py are both there. These errors all apply to wx also.

I use python3.3 on Quantal if that has any relevance.

5
  • what about _tkagg.so? Commented Mar 29, 2013 at 17:37
  • That's why it cannot import it. Commented Mar 29, 2013 at 19:30
  • how did you install mpl, and what OS are you using? Commented Mar 29, 2013 at 22:33
  • Where can I get _tkagg.so? Commented Mar 30, 2013 at 5:29
  • I installed mpl from source and I'm using Ubuntu Quantal Commented Mar 30, 2013 at 5:57

1 Answer 1

5

I was getting the same error on Fedora 18. I installed the matplotib package for Python 3 from the repository.

Installing the package python3-matplotlib-tk got rid of this error for me on Fedora.

On Ubuntu, install the tk-dev package, and install matplotlib again: python3 setup.py build and python3 setup.py install.

However, I soon ran into this one on Fedora: Python 3 and matplotlib lissue on Linux

Sign up to request clarification or add additional context in comments.

3 Comments

You may want to move the second part of your answer to a new question.
Am I doing something wrong? I typed 'sudo apt-get install python3-matplotlib-tk' into the terminal but it says that it is unable to locate the packagee.
@user2163653 Added to my answer. Install tk-dev and rebuild and reinstall should help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.