[Pythonmac-SIG] simple help?

Ronald Oussoren ronaldoussoren at mac.com
Tue Mar 7 15:56:33 CET 2006


On 7-mrt-2006, at 15:01, Charles Hartman wrote:

>
> On Mar 7, 2006, at 2:39 AM, Christopher Barker wrote:
>
>> Charles Hartman wrote:
>>> I'm getting really tired of not understanding this: Can someone
>>> point  me to some single place that explains the whole path /
>>> PATH /  PYTHONPATH arrangement for Python? I know there are two
>>> sorts on the  Mac, framework and /usr, and I know some other bits
>>> and pieces, but I  have no clear overall picture.
>>> This came to my attention when I downloaded and installed
>>> IPython,  which looks very nifty. I put it in my MacPython folder
>>> in / Applications -- but that's not really where it belongs,
>>
>> I think ipython is an executable script, so you want to put it
>> where those go. For stuff not installed by Apple, that is usually:
>>
>> /usr/local/bin
>>
>> then you want to make sure /usr/local/bin is on your PATH. You do
>> that by adding it to your /Users/YourName/.profile file, like this:
>>
>> export PATH=/usr/local/bin:$PATH
>>
>> A little googling should give you more info if you need it.
>
> Thank you. This much I knew, but it's useful to have it spelled out.
>
> I think that part of what confuses a non-Unix person like me is the
> distinction PATH / (executable programs and scripts) vs. PYTHONPATH /
> modules. (This comes up with IPython because embedding its
> interpreter in another program requires importing a module
> IPShellEmbed.) I find that my environment contains no PYTHONPATH
> variable, presumably because I've just been using the modules
> supplied with Python and with wxPython, and the installers have put
> them in (some) default places. So I assume that the new installer,
> too, won't set a PYTHONPATH.

PYTHONPATH is a way to extend the search path for python modules,  
e.g. sys.path,
while PATH is used by the unix shell to look for programs.

The new installer will indeed not set PYTHONPATH, the default module  
search
path is good enough. It will update PATH, because the bin directory  
inside
the framework is not usually on PATH.

Ronald


More information about the Pythonmac-SIG mailing list