Public bug reported:

As of 18.04, it seems that support for the GTKCairo and GTKAgg (GTK2)
backends for matplotlib (2.1.1-2ubuntu3) are broken.

To demonstrate, the following runs without error on 16.04, but produces
error messages (see below*) on 18.04:

ipython
import matplotlib; matplotlib.use('GTKAgg')
import pylab

The final error message is "ImportError: No module named _backend_gdk".
It is clear that the _backend_gdk file is not provided in the python-
matplotlib package, whereas it was in Ubuntu 16.04; see below from 'dpkg
-L python-matplotlib':

/usr/lib/python2.7/dist-packages/matplotlib/backends/_backend_gdk.x86_64
-linux-gnu.so

It seems that the Build-Depends for python-matplotlib should perhaps include 
python-gtk2-dev in order to resolve this problem:
https://stackoverflow.com/questions/14346090/importerror-no-module-named-backend-gdk


*Error messages note above:

Gtk-Message: 17:45:01.751: Failed to load module "canberra-gtk-module"

(ipython:10617): dbind-WARNING **: 17:45:01.756: Couldn't register with 
accessibility bus: Did not receive a reply. Possible causes include: the remote 
application did not send a reply, the message bus security policy blocked the 
reply, the reply timeout expired, or the network connection was broken.
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-a18b8f3c2edd> in <module>()
----> 1 import pylab

/usr/lib/python2.7/dist-packages/pylab.py in <module>()
----> 1 from matplotlib.pylab import *
      2 import matplotlib.pylab
      3 __doc__ = matplotlib.pylab.__doc__

/usr/lib/python2.7/dist-packages/matplotlib/pylab.py in <module>()
    255     window_hanning, window_none)
    256 
--> 257 from matplotlib import cbook, mlab, pyplot as plt
    258 from matplotlib.pyplot import *
    259 

/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py in <module>()
    114 ## Global ##
    115 
--> 116 _backend_mod, new_figure_manager, draw_if_interactive, _show = 
pylab_setup()
    117 
    118 _IP_REGISTERED = None

/usr/lib/python2.7/dist-packages/matplotlib/backends/__init__.pyc in 
pylab_setup(name)
     58     # imports. 0 means only perform absolute imports.
     59     backend_mod = __import__(backend_name, globals(), locals(),
---> 60                              [backend_name], 0)
     61 
     62     # Things we pull in from all backends

/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_gtkagg.py in 
<module>()
     12 from matplotlib.figure import Figure
     13 from matplotlib.backends.backend_agg import FigureCanvasAgg
---> 14 from matplotlib.backends.backend_gtk import (
     15     gtk, _BackendGTK, FigureCanvasGTK, FigureManagerGTK, 
NavigationToolbar2GTK,
     16     backend_version, error_msg_gtk, PIXELS_PER_INCH)

/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk.py in 
<module>()
     33     TimerBase, cursors)
     34 
---> 35 from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
     36 from matplotlib.cbook import is_writable_file_like, warn_deprecated
     37 from matplotlib.figure import Figure

/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_gdk.py in 
<module>()
     31 from matplotlib.mathtext import MathTextParser
     32 from matplotlib.transforms import Affine2D
---> 33 from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
     34 
     35 backend_version = "%d.%d.%d" % gtk.pygtk_version

ImportError: No module named _backend_gdk

** Affects: matplotlib (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1785458

Title:
  Support for GTK2 backends broken (18.04 bionic)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/matplotlib/+bug/1785458/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to