Reputation: 53
I am using the following setup:
Python 3.5.2 + Matplotlib 1.5.x (Raspberry Pi)
I have added backend :tkagg
to my rc file.
If I run get_backend()
it returns "tkagg"
However, when I try to import matplotlib
as follows:
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "copyright", "credits" or "license()" for more information.
>>> import matplotlib as mpl
>>> mpl.use('tkagg')
>>> import matplotlib.pyplot as plt
I receive the following traceback:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import matplotlib.pyplot as plt
File "/usr/local/lib/python3.4/dist-packages/matplotlib-1.5.0-py3.4-linux-armv7l.egg/matplotlib/pyplot.py", line 114, in <module>
backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/local/lib/python3.4/dist-packages/matplotlib-1.5.0-py3.4-linux-armv7l.egg/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/usr/local/lib/python3.4/dist-packages/matplotlib-1.5.0-py3.4-linux-armv7l.egg/matplotlib/backends/backend_tkagg.py", line 13, in <module>
import matplotlib.backends.tkagg as tkagg
File "/usr/local/lib/python3.4/dist-packages/matplotlib-1.5.0-py3.4-linux-armv7l.egg/matplotlib/backends/tkagg.py", line 9, in <module>
from matplotlib.backends import _tkagg
ImportError: cannot import name '_tkagg'
Why isn't matplotlib
being imported correctly?
Upvotes: 1
Views: 6679
Reputation: 53
I basicly follow the instruction in this post: tkagg backend problems
Then used git to get the source: sudo git clone git://github.com/matplotlib/matplotlib.git
Then did build/install using Python3.4: sudo python3.4 setup.py install
Upvotes: 1