[mod_python] make_obcallback: could not import mod_python.apache

lbradley at hush.com lbradley at hush.com
Sun Nov 21 20:26:30 EST 2004

Hash: SHA1

Thanks for your response. I'm able to import the modules from the
python interpreter invoked from the command line, and yes I can't
import _apache, which is apparently normal. You asked what version
of Unix I'm using. Its on a remote host where I don't have root,
netcraft.com says "Linux" and I'm not sure how to find out from the
command line. The host is grokthis.net, and he gives you your own
apache configuration files...But there seems to be a shared version
of mod_python so it looks at this point like its beyond my control,
its not my fault. So I'm going to go ahead and take it up with my
sysadmin. Thanks for you help!

On Sun, 21 Nov 2004 13:24:32 -0800 Graham Dumpleton
<grahamd at dscpl.com.au> wrote:
>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
>> works fine.
>> The problem system is running:
>>  Apache/2.0.49 (Unix) mod_ssl/2.0.49 OpenSSL/0.9.7d DAV/2
>> 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
>/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
>>>> 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
>>>> import mod_python.apache
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File
>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
>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
>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
>error in the logs. Ie., include the mod_python extension loading
>[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)
Note: This signature can be verified at https://www.hushtools.com/verify
Version: Hush 2.4


Concerned about your privacy? Follow this link to get
secure FREE email: http://www.hushmail.com/?l=2

Free, ultra-private instant messaging with Hush Messenger

Promote security and make money with the Hushmail Affiliate Program: 

More information about the Mod_python mailing list