[Python-modules-team] Bug#587973: Bug#587973: python-matplotlib: problem when importing pylab

Sandro Tosi morph at debian.org
Wed Jul 7 19:48:52 UTC 2010


Hello Picca,

On Sat, Jul 3, 2010 at 14:24, Picca Frederic-Emmanuel
<picca at synchrotron-soleil.fr> wrote:
> Package: python-matplotlib
> Version: 0.99.3-1
> Severity: normal
>
> Hello
>
> Here the error message when I try to import pylab
>
> picca at mordor:~$ python
> Python 2.6.5+ (release26-maint, Jul  1 2010, 00:47:18)
> [GCC 4.4.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from matplotlib import pylab
...
> ImportError: No module named _tkinter, please install the python-tk package
>
> So it seems that a dependency to python-tk is missing.

The GUI Bindings depends are there:

$ apt-cache show python-matplotlib | egrep "^Recommends|^Suggests"
Recommends: python-glade2, python-tk (>= 2.5.2-1.1)
Suggests: dvipng, ipython (>= 0.6.3), librsvg2-common,
python-configobj, python-excelerator, python-matplotlib-doc,
python-scipy, python-traits (>= 2.0), texlive-extra-utils,
texlive-latex-extra, python-gtk2, python-wxgtk2.8, python-qt3,
python-qt4

but they are chosen in a specific way: citing
/usr/share/doc/python-matplotlib/changelog.Debian.gz

    - Recommends python-tk directly and Suggests all other other Python
      bindings (changes from Ubuntu); this way the default backend ('TkAgg')
      will work out-of-the-box and the others will need manual bindings
      installation; Closes: #563137

So it turns out you disabled the Recommends installation, which is
fine, but "breaks" how mpl package works. There are some reference
also in /usr/share/doc/python-matplotlib/README.Debian .

The reason we put python-tk in Recommends is that if a user decides to
use only the GTK+ bindings, then he wants to remove the python-tk dep
(if not needed by anything else) but it's in Depends that's not
possible, while being in Recommends allows that. OTOH, Recommends are
usually installed by default, so python-tk is usually brought in, and
the other bindings are in Suggests so that a user can identify the
package he needs and install it.

If you find that enough, I'd close this bug, else the only other thing
I can do, is improve the documentation (and for that feel free to
propose some wordings).

Regards.
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi





More information about the Python-modules-team mailing list