Missing python-gtk2 dependency

Bug #223067 reported by Mark Carter
2
Affects Status Importance Assigned to Milestone
matplotlib (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: python-matplotlib

In Hardy, apt-get install python-matlibplot.

Then type: python -c "import pylab"
You get the result:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "/usr/lib/python2.5/site-packages/matplotlib/pylab.py", line 292, in <module>
    from matplotlib.pyplot import *
  File "/usr/lib/python2.5/site-packages/matplotlib/pyplot.py", line 37, in <module>
    new_figure_manager, draw_if_interactive, show = pylab_setup()
  File "/usr/lib/python2.5/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup
    globals(),locals(),[backend_name])
  File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtkagg.py", line 10, in <module>
    from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\
  File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py", line 7, in <module>
    import gtk; gdk = gtk.gdk
ImportError: No module named gtk

To fix the problem, you need to apt-get install python-gtk2. You can then import pylab successfully.

Related branches

Revision history for this message
Mark Carter (mcturra2000) wrote :

Grrr. When I said python-matlibplot, I meant python-matplotlib.

Revision history for this message
LaserJock (laserjock) wrote :

Hmm, this is odd a bit of an odd situation I guess. The dependency for python-matplotlib is:

python-gd (>= 0.52) | python-pypaint | python-gtk2 | python-wxgtk2.8 | python-qt3 | python-qt4

Basically just saying you need *one* of the possible backends. However, the default matplotlibrc (/etc/maplotlibrc) has:

backend : GTKAgg

so technically we should probably change the dependency to:

python-gtk2 | python-gd (>= 0.52) | python-wxgtk2.8 | python-qt3 | python-qt4

we can also drop the python-pypaint dependency as there is no such package in Debian or Ubuntu.

However, the default Ubuntu install does include python-gtk so I imagine the only time you'd run into the bug would be on a server install. Is that the case for you Mark?

Changed in matplotlib:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
William Grant (wgrant) wrote :

Having it depend on it is wrong. I generally use Agg rather than GTKAgg, and I don't really want Python GTK bindings following me around just for that.

Revision history for this message
Mark Carter (mcturra2000) wrote :

Jordan, I am using Hardy Kubuntu (desktop).

Revision history for this message
LaserJock (laserjock) wrote :

Well, we gotta pick something :-)

Right now the matplotlibrc sets the backend to be GTKAgg, which of course you can easily change and upstream encourages you to make you're own .matplotlibrc . I'm just saying that we should probably be consistent between the default backend and the default installed backend dep, right? Unless you want to use debconf I don't see how we're gonna be able to really make everybody happy. We could just set the default backend to Agg.

Mark, I guess that would explain why you don't have python-gtk ;-)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package matplotlib - 0.91.2-2ubuntu1

---------------
matplotlib (0.91.2-2ubuntu1) intrepid; urgency=low

  * Merge from Debian unstable (LP: #233959). Remaining Ubuntu changes:
  * debian/control:
    - Change Maintainer/XSBC-Original-Maintainer field,
    - Update Build-depends: python-wxgtk2.6 -> 2.8
    - Change order of dependencies so python-gtk2 is first (LP: #223067).
  * debian/docs: adding various doc files to binary package
  * Revert to TkAgg backend instead of GTKAgg which has been the default
    in the several last Ubuntu releases. TkAgg is also the default backend
    in the Debian version. Bug (LP: #220137) seems to indicate that GTKagg
    does not work as expected, either by design or from a bug.
  * debian/rules:
    - copy debian/setup.cfg to $(CURDIR), to make TkAgg the default.
    - call dh_link for the indep target.
  * Also install /usr/share/matplotlib/matplotlib.conf, and create
    a link from /etc/matplotlibrc to /usr/share/matplotlib partly solving
    the problem described in Launchpad bug 126318.
  * debian/README.debian: add note on use of environmental variable.
  * Closing other bugs fixed by this version:
    - PDF generation is working in this version (LP: #114707)
    - personal settings file in ~/.matplotlib/matplotlibrc (LP: #124621)
    - quiver interface refactored from upstream (LP: #134919)

matplotlib (0.91.2-2) unstable; urgency=medium

  * debian/patches/bts-478237_ftbfs_gcc43.patch
    - added (Closes: #478237)
  * debian/rules
    - removed some files changes during build
  * debian/control
    - removed Depends on python-numeric-ext, python-numarray-ext (Closes:
      #478451)

matplotlib (0.91.2-1) unstable; urgency=low

  [ Piotr Ożarowski ]
  * Replace libwxgtk2.4-python with python-wxgtk2.6 in Depends
    (closes: #466470)

  [ Sandro Tosi ]
  * New upstream release (Closes: #459200, #474001, #447741, #408955)
  * debian/patches/build_fix.patch
    - edited to match new code
  * debian/rules
    - adjusted doc files installation
  * debian/docs
    - removed since the same files were already in debian/rules
  * debian/patches/matplotlibrc_fix.patch
    - edited to match new code (sync from Ubuntu)
  * debian/control
    - added "dvipng, python-configobj, python-enthought-traits (>= 2.0),
      python-qt-dev, python-qt4-dev, python-wxgtk2.6" as build-dep (sync from
      Ubuntu)
    - bump depends on python-numpy (sync from Ubuntu)
    - added "python-qt4, dvipng, python-configobj, python-enthought-traits (>=
      2.0)" to Depends (sync from Ubuntu)
    - merged Recommends into Depends
    - removed Depends on python-pypaint since that package is unavailable
    - added myself to Uploaders
  * debian/patches/bts-468977_memory_api_usage.patch
    - fixes Python API memory usage (Closes: #468977)

 -- Morten Kjeldgaard <email address hidden> Fri, 30 May 2008 14:17:03 +0200

Changed in matplotlib:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.