import matplotlib.pyplot gives ImportError: No module named _tkagg
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| matplotlib (Ubuntu) |
Undecided
|
Unassigned |
Bug Description
The default TkAgg backend for matplotlib dosn't work and gives the folowing error when
pyplot is imported in both python 2.6 and 2.5
>>> import matplotlib.pyplot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
new_
File "/usr/lib/
globals(
File "/usr/lib/
import tkagg # Paint image to Tk photo blitter extension
File "/usr/lib/
import _tkagg
ImportError: No module named _tkagg
However if you change the backend in /etc/matplotlibrc to QT4 (and maybe others) everything works fine
using matplotlib 0.98.5.2-1ubuntu1 on kubuntu 9.04 alpha 5
Related branches
Václav Šmilauer (eudoxos) wrote : | #1 |
Václav Šmilauer (eudoxos) wrote : | #2 |
BTW no mention of such change in changelogs, either.
Václav Šmilauer (eudoxos) wrote : | #3 |
After rebuilding the package locally, _tkagg.so installs just fine. OTOH then I get RuntimeError: Could not find the matplotlib data files from /usr/lib/
Václav Šmilauer (eudoxos) wrote : | #4 |
Correcting my mistake in the last post: should read MATPLOTLIBDATA=
Changed in matplotlib: | |
status: | New → Confirmed |
Daniel J Blueman (danielblueman) wrote : | #5 |
I find that rebuilding matplotlib addresses the issue, without need for setting the environment variable here.
Andrew Straw (astraw) wrote : | #6 |
I can confirm this bug with 0.98.5.2-1ubuntu1. I have a patch to the source and confirmed that it builds the _tkagg module and fixes this bug. I include the debdiff file produced from the source I used.
LaserJock (laserjock) wrote : | #7 |
Andrew, thanks a ton for the debdiff. One question though, what are the changes in debian/rules for? Why are you rm'ing the build directory?
Andrew Straw (astraw) wrote : | #8 |
Jordan, the "rm -rf build" is in the clean target -- this is only used for cleaning up the tree after a build and before a new one. "dh-clean build", which I removed, was breaking if the build directory wasn't there, whereas the rm command does not break. Really, I should probably test for the existence of the directory and only delete it in that case, but I couldn't remember the syntax, whereas "rm -rf" is pretty much hardwired into my spinal ganglia.
Benjamin Drung (bdrung) wrote : | #9 |
0.98.5.
Benjamin Drung (bdrung) wrote : | #10 |
I have added the bug number to the changelog entry. I can confirm that this patch works. So please sponsor Andrews patch.
Daniel Holbach (dholbach) wrote : | #11 |
Uploaded. Sitting in the queue.
Changed in matplotlib (Ubuntu): | |
status: | Confirmed → Fix Committed |
Launchpad Janitor (janitor) wrote : | #12 |
This bug was fixed in the package matplotlib - 0.98.5.2-1ubuntu2
---------------
matplotlib (0.98.5.2-1ubuntu2) jaunty; urgency=low
* Really build with tcl/tk8.5 as python-tk was build with tcl/tk8.5
(LP: #337469).
-- Andrew Straw <email address hidden> Sat, 21 Mar 2009 14:55:09 -0700
Changed in matplotlib: | |
status: | Fix Committed → Fix Released |
Youen (youen-peron) wrote : | #13 |
I have the same bug with an upgraded Nasty from a clean Manvrik. I don't known if i must open a new issue or reopen this one.
Jan Groenewald (jan-aims) wrote : | #14 |
This bug is present on Natty Development branch at the moment.
Should a new bug be filed?
jan@milaine-
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/
from matplotlib.pylab import *
File "/usr/lib/
from matplotlib.pyplot import *
File "/usr/lib/
new_
File "/usr/lib/
globals(
File "/usr/lib/
import tkagg # Paint image to Tk photo blitter extension
File "/usr/lib/
import _tkagg
ImportError: No module named _tkagg
jan@milaine-
ii python-tk 2.7-2ubuntu2 Tkinter - Writing Tk applications with Python
jan@milaine-
I can confirm that this is an issue in Natty. It happened with today's batch of updates, since it was not a problem yesterday.
Marcel Stimberg (marcelstimberg) wrote : | #16 |
Please follow bug #752647 for this issue in Natty.
Confirming. This is a regression from intrepid and cen be verified by inspection of package contents list. _tkagg.so doesn't exist anymore in jaunty.