[mod_python] problems finding module

Vince Buonassisi vjb at vuit.com
Wed Apr 23 20:59:17 EST 2003


sorry, i forgot to add my environment:

python 2.2.2
apache 2.0.40
modpython 3.0.3

thanks,


On Mercoledì, apr 23, 2003, at 20:25 US/Pacific, Vincent J. Buonassisi 
wrote:

> hi,
>
> i am having problems in getting mod_python to run the following simple 
> script in apache:
>
> 	import sys
>
> 	from WVWService.util import XMLUtil
>
> 	from mod_python import apache
>
> 	def handler(req):
>
>    	 path = str(sys.path)
>    	 print path
>    	 req.content_type = "text/plain"
>    	 req.send_http_header()
>     	req.write(path)
>
>     	return apache.OK
>
> 	if __name__ == "__main__":
>   	  print sys.path
>
> with the followig entry in apache's httpd.conf file:
>
> 	<Directory /var/www/html>
>   	    AddHandler python-program .py
>    	    PythonHandler myscript
> 	    PythonPath
> 		"sys.path+['/home/vjb/workspace/wvwBase3/src/wvw']"
>    	    PythonDebug On
> 	</Directory>
>
>
> i get the following error in my web browser:
>
>
> Mod_python error: "PythonHandler myscript"
>
> Traceback (most recent call last):
>
>   File "/usr/local/lib/python2.2/site-packages/mod_python/apache.py", 
> line 320, in HandlerDispatch
>     module = import_module(module_name, config)
>
>   File "/usr/local/lib/python2.2/site-packages/mod_python/apache.py", 
> line 496, in import_module
>     f, p, d = imp.find_module(parts[i], path)
>
> ImportError: No module named myscript
>
>
> if i comment the PythonPath line the i get the error:
>
> ImportError: No module named WVWService.util
>
>
> can someone please tell me what i am doing wrong?
>
> thanks,
>
> vince
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
>




More information about the Mod_python mailing list