I would guess that the PATH, PYTHONPATH, pth, and site-packages  
issues are close to the number one
FAQ for mac python newbies (and not really fully understood by many  
oldies like me)

I would be happy to take a shot at writing up some documentation  
probably should go under
setting up your user environment.

I remember that there are some obscure details associated with the   
pythonpath for cgi scripts in apache

The python library ref for cgi states (or stated some time ago).
"In particular, don't count on ...the Python module search path  
(PYTHONPATH) to be set to anything interesting.

One way to fix it is to use the setEnv directive in apache

<IfModule mod_env.c>
       SetEnv PYTHONPATH "/Users/smithsm/Development/python:/Users/ 
smithsm/Development/python/ht:/sw/lib/python2.2:/sw/lib/python2.2/ 
plat-darwin:/sw/lib/python2.2/lib-tk:/sw/lib/python2.2/lib-dynload:/ 
sw/lib/python2.2/site-packages:/sw/lib/python2.2/site-packages/ 
Numeric:/sw/lib/python2.2/site-packages/PIL"
</IfModule>
#quotes optional

The final path that python sees as sys.path in the cgi script is  
composed of a list in order of

the directory wherein resides the cgi script
the apache setenv PYTHONPATH
the default sys.path

Another suggestion was to put a .pth file in the cgi-bin directory  
holding the python cgi script. I never tested that.

Any changes to this behavior in 2.4.2 or with mod_python?



On 09 Mar, 2006, at 12:31, Ronald Oussoren wrote:

>
> On 9-mrt-2006, at 18:38, Christopher Barker wrote:
>
>> Bob Ippolito wrote:
>>> On Mar 8, 2006, at 4:28 PM, Samuel M. Smith wrote:
>>>> So does the new Python Installer create ~/Library/Python/2.4/site-
>>>> packages? Or must one create it manually?
>>>
>>> One must create it manually.
>>
>> I think it should create it, it will make things a tiny bit easier  
>> for
>> some folks, and what's the harm?
>
> Nothing will automaticly install in ~/Library/Python/2.4/site- 
> packages,
> which means automaticly creating the directory is not very useful. I'm
> sure I wouldn't notice the directory if it were created, and I'm sure
> I wouldn't be the only one.
>
> This doesn't mean we shouldn't improve the documentation :-).
>
> Ronald
>>
>> -CHB
>>
>>
>> -- 
>> Christopher Barker, Ph.D.
>> Oceanographer
>>
>> NOAA/OR&R/HAZMAT         (206) 526-6959   voice
>> 7600 Sand Point Way NE   (206) 526-6329   fax
>> Seattle, WA  98115       (206) 526-6317   main reception
>> _______________________________________________
>> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
>> http://mail.python.org/mailman/listinfo/pythonmac-sig
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig

**********************************************************************
Samuel M. Smith Ph.D.
2966 Fort Hill Road
Eagle Mountain, Utah 84043
801-768-2768 voice
801-768-2769 fax
**********************************************************************
"The greatest source of failure and unhappiness in the world is
giving up what we want most for what we want at the moment"
**********************************************************************

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to