[Pythonmac-SIG] How to provide additions to python path such thatall executions of a given python binary will see them?

Mario Ruggier mario at ruggier.org
Thu Jun 24 10:27:52 EDT 2004


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?

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?

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?

mario


> Ronald
>>
>> Thanks,
>> Ken McDonald




More information about the Pythonmac-SIG mailing list