473,378 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Cannot import mod_python modules

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
3 1915
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gregory (Grisha) Trubetskoy | last post by:
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.2.7 release of mod_python. Mod_python 3.2.7 is considered a stable release, suitable for production...
0
by: Gregory (Grisha) Trubetskoy | last post by:
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.2.10 release of mod_python. Mod_python 3.2.10 is considered a stable release, suitable for production...
10
by: Vincent Delporte | last post by:
Hi I'm still a newbie when it comes to web applications, so would like some help in choosing a solution to write apps with Python: What's the difference between using running it through...
5
by: m.banaouas | last post by:
Hi, bonjour, witch versions are suitable to use for apache & mod_python ? Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent versions) without facing any known major...
1
by: blbmdsmith | last post by:
Has anyone seen the following error while starting httpd: Starting httpd: httpd: Syntax error on line 54 of /usr/local/apache2/conf/httpd.conf: API module structure `python_module' in file...
11
by: Cecil Westerhof | last post by:
I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse I can not time the time used to import time, but os and sys do not take more as a millisecond. My script itself takes 3 or...
0
by: Gregory (Grisha) Trubetskoy | last post by:
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.3.1 release of mod_python. Mod_python 3.3.1 is considered a stable release, suitable for production...
1
TMS
by: TMS | last post by:
I installed mod_python 3.3.1 for Apache 2.0.58 and Windows XP. Per instructions I added this line to the httpd.conf file: LoadModule mod_python modules/mod_python.so And I get this error: ...
1
by: jpuopolo | last post by:
Hi, all... I am hoping that someone can help me with the magic incantation to get mod_python working on my local machine. Set up: Apache 2.2.9, mod_python 3.3.1 on Windows Vista (yes, pity...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.