[mod_python] In ubuntu 6.06! make_obcallback(): could not import mod_python.apache

Graham Dumpleton grahamd at dscpl.com.au
Wed Aug 9 05:50:26 EDT 2006


These problems are always hard to debug when using mod_python 2.7.X.
Some extra debug was added in mod_python 3.2.10 to make it easier to
work out, but that requires Apache 2.0/2.2 and you can't use Apache 1.3.

Anyway, all I can think of is that the user that Apache runs as is  
finding a
different version of the python executable on its PATH or it is  
getting confused
by you having multiple versions installed. Do you have any other  
versions
of Python installed, such as in /usr/local/bin, even perhaps a  
symlink there
pointing to python2.3.

Any chance of upgrading to Apache 2.2 and mod_python 3.2.10?

Graham

On 08/08/2006, at 5:24 PM, yeqiwei wrote:

> My os is Ubuntu 6.06.
> Apache is 1.3.34
> mod_python is 2.7.10
> python 2.4.1a0
> I install these software using the apt-get install command.
>
> apache documentroot is /var/www. And I make a dir test.
>
> in http.conf, I write this:
> <Directory /var/www/test>
> 		AddHandler python-program  .py
> 		PythonHandler mptest
>         PYtohnDebug On
> </Directory>
>
> and in the modules.conf
> LoadModule  python_module /usr/lib/apache/1.3/mod_python
>
> in /var/www/test, I put a mptest.py file the content is
> from mod_python import apache
>
> def handler(req):
>     req.send_http_header()
>     req.write("Hello World!")
>     return apache.OK
>
> when I point to http://127.0.0.l/test/mptest.py,  get the 500  
> Internal Server Error
> And I check the apache error.log,fount that
>
> make_obcallback():could not import mod_python.apache
> make_obcallback():could not call init
> ........python_handler: make_obcallback returned no obCallBack!
>
>
> I have install python2.3 and python 2.4,but the /usr/bin/python is  
> linked to
> the /usr/bin/python2.4.
> And I run mptest.py in shell, the error information is that:
>
> Traceback (most recent call last)
>  File "/var/www/test/mptest.py",line 1, in ?
>    from mod_python import apache
>  File "/usr/lib/python2.4/site-packages/mod_python/apache.py",line  
> 55 in ?
>    import _apache
> ImportError: No module named _apache
>
>
> How can I solve this problem?
>
>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list