[Pythonmac-SIG] How to provide additions to python path such
thatall executions of a given python binary will see them?
Bob Ippolito
bob at redivi.com
Thu Jun 24 21:44:39 EDT 2004
On Jun 24, 2004, at 10:27 AM, Mario Ruggier wrote:
> On Jun 22, 2004, at 4:25 PM, Ronald Oussoren wrote:
>> On Friday, June 18, 2004, at 02:55AM, Kenneth McDonald
>> <kenneth.m.mcdonald at sbcglobal.net> wrote:
>>
>>> Currently, I modify my python path through inclusion of a PYTHONPATH
>>> variable
>>> in the .login file. However, I need to add a /local/python/packages
>>> directory
>>> to the path in such a manner that all executions of the system python
>>> binary
>>> see /local/python/packages. I was just wondering up the best (least
>>> hacky)
>>> way of doing this might be.
>>
>> create /Library/Python/2.3/local.pth containing the line
>> /local/python/packages.
>>
>> The exact name of the file is not important, as long as it has the
>> suffix '.pth'.
>
> What exactly should /Library/Python/2.3/local.pth contain? I.e. what
> is the syntax for adding a dir to pythonpath in this way?
It should contain EXACTLY and ONLY the path you would like added.
Literally, the line "/local/python/packages", sans quotes.
% python -c 'file("/Library/Python/2.3/local.pth",
"w").write("/local/python/packages")'
> And, are the effects of doing it this way different than the way that
> Jack has just posted, that is to add env. variables to
> ~/.MacOSX/environment.plist that are then read at login time?
It's not a PITA like PYTHONPATH (worst.. idea... ever..).
> In my /Library/Python/2.3 directory, the README says:
> ====
> This directory exists so that 3rd party packages can be installed
> here. Read the source for site.py for more details.
> ====
> But, there is no site.py ? Where should this be?
site.py is part of Python itself, and it thus at:
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/
site.py
-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040624/f29603cc/smime-0001.bin
More information about the Pythonmac-SIG
mailing list