installs modules to a wrong place

Michal Ludvig mludvig at
Sat Dec 13 04:48:31 EST 2008


I have recently seen some reports from users of my s3cmd script [1] who
installed the package using the provided distutils-based and
immediately after installation the script failed to run because it
couldn't find its modules.

Here's an example session from Mac OS X, but similar behaviour has been
observed on Ubuntu as well. Needless to say it works for me just fine so
I can't easily debug and fix it :-(

First is the reported output:

~/bin/s3cmd $ sudo python install
running install_lib
creating /usr/lib/python2.5/site-packages
creating /usr/lib/python2.5/site-packages/S3
copying build/lib/S3/ -> /usr/lib/python2.5/site-packages/S3
... more modules, etc ...

It decided to put the modules to /usr/lib/python2.5/site-packages/S3

Now, s3cmd should import from there, but fails:

~/bin/s3cmd $ s3cmd
Traceback (most recent call last):
   File "/usr/bin/s3cmd", line 1207, in <module>
     from S3 import PkgInfo
ImportError: No module named S3

sys.path at the time the script died had these entries:

There is nothing special in After all have a look yourself:

What could be the reason for distutils / to install the modules
to a directory that's not in sys.path? Can I detect it in and
prevent or workaround it somehow?


[1] -- Amazon S3 command line client


More information about the Python-list mailing list