By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,594 Members | 1,452 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,594 IT Pros & Developers. It's quick & easy.

Cannot import mod_python modules

P: n/a
Hi, I've just installed the Win32 build of mod_python 3.1.4 for Python
2.4 and have setup my Apache config file with the LoadModule and
PythonHandler directives and then copied "mod_python.so" to my Apache
modules directory.

I restarted Apache and decided to do a quick cgi.test() and it shows
that mod_python listed under server software section.

OK, next I tried mptest.py, but I get an Internal Server Error. The
traceback recorded in the error log says "No module named _apache"

mptest.py:

from mod_python import apache

def handler(req):
req.write("Hello World!")
return apache.OK

Why doesn't this work? or rather what have I missed?
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Mark wrote:
Hi, I've just installed the Win32 build of mod_python 3.1.4 for Python
2.4 and have setup my Apache config file with the LoadModule and
PythonHandler directives and then copied "mod_python.so" to my Apache
modules directory.

I restarted Apache and decided to do a quick cgi.test() and it shows
that mod_python listed under server software section.

OK, next I tried mptest.py, but I get an Internal Server Error. The
traceback recorded in the error log says "No module named _apache"

mptest.py:

from mod_python import apache

def handler(req):
req.write("Hello World!")
return apache.OK

Why doesn't this work? or rather what have I missed?


Usually this is a permissions issue, often because you installed
mod_python as a non-administrator.

regards
Steve
--
Steve Holden +1 703 861 4237 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/

Jul 18 '05 #2

P: n/a
Thanks for the reply Steve,

I have re-installed mod_python and re-configured Apache and it works
now. I'm not exactly sure what I done differently, but oh well at
least it works now :)

Regards,

Mark.
Jul 18 '05 #3

P: n/a
Mark wrote:
Thanks for the reply Steve,

I have re-installed mod_python and re-configured Apache and it works
now. I'm not exactly sure what I done differently, but oh well at
least it works now :)

Regards,

Mark.


Right, no point wasting much sleep when mod_python awaits!

regards
Steve
--
Steve Holden +1 703 861 4237 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/

Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.