[mod_python] make_obcallback: could not import mod_python.apache

Graham Dumpleton grahamd at dscpl.com.au
Sun Nov 21 16:24:32 EST 2004


On Nov 21 02:00, <lbradley at hush.com> wrote:
>
> I'm trying to get mod python working on a unix host. When I set
> it up according to the instructions, I get a 500 error and the
> following in my error log:
> make_obcallback: could not import mod_python.apache
> 
> On Apache 2 on my local computer (running XP) the exact same setup
> works fine.
> The problem system is running:
>  Apache/2.0.49 (Unix) mod_ssl/2.0.49 OpenSSL/0.9.7d DAV/2 PHP/4.3.6
> mod_python/3.1.3 Python/2.3.4
> 
> Any ideas?

One of the reasons you will get that error is if the Python modules for mod_python
are not actually installed, or not installed in the location where the version of
Python used by mod_python expects them to be.

What happens when you run Python on the command line and try and import
mod_python?

/usr/local/apache-2.0/logs [509]$ python
Python 2.3 (#1, Sep 13 2003, 00:49:11) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mod_python.apache
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named mod_python.apache
>>>

Do you get whats above or what is below?

/usr/local/apache-2.0/logs [510]$ python
Python 2.3 (#1, Sep 13 2003, 00:49:11) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mod_python.apache
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/
mod_python/apache.py", line 28, in ?
    import _apache
ImportError: No module named _apache
>>> 

If you get the first error then mod_python isn't even installed correctly for the
version of Python being used. Get the second error and it is at least installed.
You will get the error about "_apache" as it only exists when modules are
imported within the contect of a running Apache process under mod_python
Apache handler.

If you have multiple versions of Python installed, make sure you do this with
the exact version that mod_python handler for Apache is actually using.

If you want further help you are going to have to say which UNIX platform you
are on. Also, show the full error messages appearing around the make_obcallback
error in the logs. Ie., include the mod_python extension loading message.

[Mon Nov 22 08:12:39 2004] [notice] mod_python: Creating 32 session mutexes based on 6 max 
processes and 25 max threads.
[Mon Nov 22 08:12:40 2004] [notice] Apache/2.0.51 (Unix) mod_python/3.1.3 Python/2.3 configured 
-- resuming normal operations
[Mon Nov 22 08:13:24 2004] [error] make_obcallback: could not import mod_python.apache.\n 

--
Graham Dumpleton (grahamd at dscpl.com.au)


More information about the Mod_python mailing list