setup.py installs modules to a wrong place

Discussion in 'Python' started by Michal Ludvig, Dec 13, 2008.

  1. Hi,

    I have recently seen some reports from users of my s3cmd script [1] who
    installed the package using the provided distutils-based setup.py 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 setup.py output:

    -----
    ~/bin/s3cmd $ sudo python setup.py install
    Password:
    ....
    running install_lib
    creating /usr/lib/python2.5/site-packages
    creating /usr/lib/python2.5/site-packages/S3
    copying build/lib/S3/PkgInfo.py -> /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:
    /usr/bin
    /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip
    /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
    /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin
    /System/Library/Frameworks/Python.framework/Versions/2.5/...other_subdirs...
    /Library/Python/2.5/site-packages

    There is nothing special in setup.py. After all have a look yourself:
    http://s3tools.svn.sourceforge.net/viewvc/s3tools/s3cmd/trunk/setup.py?view=markup

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

    Thanks!

    [1] http://s3tools.logix.cz/s3cmd -- Amazon S3 command line client

    Michal
     
    Michal Ludvig, Dec 13, 2008
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Nishizawa
    Replies:
    0
    Views:
    372
    Mike Nishizawa
    Apr 15, 2004
  2. Sibylle Koczian
    Replies:
    4
    Views:
    684
    Sibylle Koczian
    Jan 25, 2005
  3. Ben Weintraub

    Disabling modules using Modules/Setup

    Ben Weintraub, Sep 9, 2006, in forum: Python
    Replies:
    0
    Views:
    458
    Ben Weintraub
    Sep 9, 2006
  4. Chris Shenton
    Replies:
    1
    Views:
    1,712
    =?ISO-8859-1?Q?Michael_Str=F6der?=
    Aug 24, 2007
  5. Michal Ludvig
    Replies:
    2
    Views:
    496
    Michal Ludvig
    Dec 29, 2008
  6. Malte Milatz
    Replies:
    0
    Views:
    138
    Malte Milatz
    Jun 22, 2004
  7. Intransition

    [ANN] Ruby Setup 5 (setup.rb)

    Intransition, Jan 13, 2010, in forum: Ruby
    Replies:
    0
    Views:
    561
    Intransition
    Jan 13, 2010
  8. johannes falcone
    Replies:
    0
    Views:
    253
    johannes falcone
    Apr 25, 2013
Loading...