[Python-modules-team] Bug#662965: Python doesn't find the connector module -- missing symlinks?

David Paleino dapal at debian.org
Wed Mar 7 17:30:52 UTC 2012


On Wed, 7 Mar 2012 18:03:17 +0100, Sandro Tosi wrote:

> On Wed, Mar 7, 2012 at 17:29, David Paleino <dapal at debian.org> wrote:
> > after installation of said package, python isn't able to find the module:
> >
> > $ python -c 'import mysql.connector'
> > Traceback (most recent call last):
> >  File "<string>", line 1, in <module>
> > ImportError: No module named connector
> > $
> 
> that's weird because it works on several of my machines and also in a
> clean pbuilder chroot; have you tried reinstalling it? remove +
> reinstall?
> 
> $ python -c 'import mysql.connector as a ; print a.__file__'
> /usr/lib/pymodules/python2.7/mysql/connector/__init__.pyc
> $ readlink -f /usr/lib/pymodules/python2.7/mysql/connector/__init__.py
> /usr/share/pyshared/mysql/connector/__init__.py

This is strange indeed, sorry for not checking before: in a clean chroot, it
works.

On my host system, I *do* have /usr/lib/pymodules/.../connector/, but python is
still not seeing it. I'm running it inside an almost-empty /tmp/, so there's no
chance some local mysql/ directory could interfere with it.

Any hint on how to debug what's happening? Some more info:

- in chroot (where it works):

  # python -c 'import sys; print "\n".join(sys.path)'

  /usr/lib/python2.7
  /usr/lib/python2.7/plat-linux2
  /usr/lib/python2.7/lib-tk
  /usr/lib/python2.7/lib-old
  /usr/lib/python2.7/lib-dynload
  /usr/local/lib/python2.7/dist-packages
  /usr/lib/python2.7/dist-packages
  /usr/lib/pymodules/python2.7

- on my host (where it doesn't work):

  $ python -c 'import sys; print "\n".join(sys.path)'

  /usr/lib/python2.7
  /usr/lib/python2.7/plat-linux2
  /usr/lib/python2.7/lib-tk
  /usr/lib/python2.7/lib-old
  /usr/lib/python2.7/lib-dynload
  /usr/lib/python2.7/dist-packages
  /usr/lib/python2.7/dist-packages/PIL
  /usr/lib/pymodules/python2.7/gtk-2.0
  /usr/lib/python2.7/dist-packages/gst-0.10
  /usr/lib/python2.7/dist-packages/gtk-2.0
  /usr/lib/pymodules/python2.7
  /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode

There are obviously more paths (due to more packages being installed), but the
"fundamental" ones are there. Worth noting is that /usr/lib/pymodules/python2.7
is actually in PYTHONPATH, also on my host system!

Any help would be much apreciated, thanks :)

> > Checking "dpkg -L", it seems like the package is missing the symlinks
> > under /usr/lib/python*/*/.
> 
> that's not the problem: python-support creates the symlinks tree at
> install time (via trigger).

Aw, right. Totally forgot it :)

Ciao e grazie,
David

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://deb.li/dapal
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20120307/81d37eb0/attachment.pgp>


More information about the Python-modules-team mailing list