Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Appending to sys.path during module install with distutils

Reply
Thread Tools

Appending to sys.path during module install with distutils

 
 
Darren Hart
Guest
Posts: n/a
 
      10-30-2011
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No install menu during W7 64 bit install - help? Donnie Windows 64bit 12 05-03-2012 07:08 PM
distutils, No module named numpy.distutils.fcompiler.conv_template Luis Alberto Zarrabeitia Gomez Python 0 03-30-2009 03:56 PM
can distutils windows installer invoke another distutils windows installer timw.google Python 1 05-11-2006 10:07 PM
Ruby 1.8.3 preview 1. AIX 5.2. Bug in do-install-doc during make install Philippe Lucas Ruby 0 06-28-2005 12:59 PM
Prevent Netscape from appending .aspx during FileSave? Steve E. ASP .Net 0 11-11-2003 07:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57