[mod_python] Re: \[mod_python\] In ubuntu 6\.06\! make_obcallback\(\): could not import mod_python\.apache

Graham Dumpleton grahamd at dscpl.com.au
Wed Aug 9 06:46:52 EDT 2006


Looks like your Python 2.4 installation has been stuffed up, or you have
Python 2.4.1a0 installed somewhere else on your box as well and that
is what is being found. One possibility is that Python 2.4 package is  
split
into main and dev and you have main from Python 2.4.3 but dev from the
older Python 2.4.1a0 and that is stuffing things up.

Graham

On 09/08/2006, at 8:36 PM, yeqiwei wrote:

> Thanks!
> In my os,the /usr/bin/python is linking to /usr/bin/python2.4.
>
> I solved this problem by replacing libapache-mod-python2.4 with  
> libapache-mod-python2.3,
> And using python2.3 instead of python2.4
>
> the python2.4 version in ubuntu is python 2.4.3,
> in apache log, I find that "mod_python/2.7.10 Python/2.4.1a0"
> does this matter? 2.4.1a0 or  2.4.3
>
>> 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