Appending to sys.path during module install with distutils

Discussion in 'Python' started by Darren Hart, Oct 30, 2011.

  1. Darren Hart

    Darren Hart Guest

    I'm trying to use distutils to install a collection of modules in
    /usr/local/lib/python2.7/site-packages. My distribution (Fedora 15)
    doesn't include any /usr/local paths in sys.path, so the import fails
    when running the program. The distutils documentation suggests adding
    a $NAME.pth file to an existing site-packages directory in sys.path.
    Is there a preferred/accepted method of doing this?

    I considered just adding some code to my setup.py to generate a
    braindump.pth file containing something like:

    PREFIX/lib/pythonMAJOR.MINOR/site-packages

    and then walking the existing sys.path and picking one of those
    site-packages directories to install braindump.pth to. I'm not sure
    how to determine which is the appropriate path.

    Maybe I'm going about this completely wrong as well - anyone care to
    help steer me in the right direction?

    The project is located here: http://braindump.dvhart.com in case
    anyone wants it for reference.

    Thanks,

    --
    Darren Hart
    Darren Hart, Oct 30, 2011
    #1
    1. Advertising

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. Replies:
    3
    Views:
    398
  2. Greg McIntyre
    Replies:
    0
    Views:
    431
    Greg McIntyre
    Sep 12, 2005
  3. gen_tricomi
    Replies:
    2
    Views:
    737
    gen_tricomi
    May 23, 2006
  4. mhearne808[insert-at-sign-here]gmail[insert-dot-he

    Appending to sys.path

    mhearne808[insert-at-sign-here]gmail[insert-dot-he, Mar 24, 2009, in forum: Python
    Replies:
    1
    Views:
    367
    Peter Otten
    Mar 24, 2009
  5. Luis Alberto Zarrabeitia Gomez

    distutils, No module named numpy.distutils.fcompiler.conv_template

    Luis Alberto Zarrabeitia Gomez, Mar 30, 2009, in forum: Python
    Replies:
    0
    Views:
    1,301
    Luis Alberto Zarrabeitia Gomez
    Mar 30, 2009
Loading...

Share This Page