[mod_python] Problem with 'import' statement in 'execfile' script

Günter Dannoritzer dannoritzer at web.de
Sat Dec 13 13:41:29 EST 2003


Thanks for all the help I got on this problem.

Mike,

I was not able to test the 'PythonPath' directive yet, but I did add the 
sys.path.append to the publisher handler script and it worked.

It seems like I cannot modify the sys.path in a script I call with the 
execfile command when using mod_python.

Guenter


Michael C. Neel wrote:

>>import sys
>>sys.path.append('/ab/system')
>>from Tools.Utilities import Utilities
>>
>>    
>>
>
>Have you tried using the PythonPath directive
>(http://www.modpython.org/live/current/doc-html/dir-other-pp.html)?  I'm
>not sure if setting the path inside the script is something you can do
>(but again, I'm not sure).
>
>Mike
>
>  
>




More information about the Mod_python mailing list