[mod_python] Importing modules in a new process.

Joseph Bernhardt joe at incomps.com
Tue Apr 8 12:12:38 EDT 2008


I have been having this problem for a while, but it has just recently gotten
to be enough of a bother that I thought I should figure out what's going on.
I have a simple application (myapp.py) as follows:

 

import my_module

import datetime

import sys

 

print "Hello World."

 

Which (of course) runs fine from the interpreter.  The problem is when I
start that application with the subprocess module via a separate application
through mod_python and a web request (initiate.py) as follows:

 

import subprocess

 

subprocess.Popen(['python myapp.py', shell=True)

 

When myapp.py is initiated through the Popen, it is unable to locate the
my_module module and fails.  When 'import my_module' is removed the
application completes fine, which leads me to believe it is a problem with
the my_module module.  Since I am able to run myapp.py fine from the
interpreter rather than remotely, I was assuming that there was a
permissions problem with the module.  Unfortunately, it still gave me the
same err with 777 permissions.  

 

Can anyone suggest where to go from here, please?  

 

Joseph Bernhardt 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080408/3f8c2f75/attachment.html


More information about the Mod_python mailing list