There isn't a bug with the CentOS/RHEL packages. Python includes modules, classes, exceptions, very high level dynamic data types and dynamic typing. 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 You are currently viewing LQ as a guest.
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. It's quick & easy. I can build & install mod_python fine now. You likely have another python binary in the fron of your path and the os.py provided by that python does not include urandom. http://modpython.org/pipermail/mod_python/2004-November/016815.html
Tags: 500 server error, apache, error, mod_python.apache, obcallback, Python. 1 Comment » One Response to "Error: make_obcallback: could not import mod_python.apache" Cristian Navalici Says: December 7, 2008 at 6:52 pm Another 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. I.e., first time, yes. 2nd time, no, etc.
References: Modpython FAQ python/makeobcallback.txt · Last modified: 2013/03/16 17:40 (external edit) Page Tools BacklinksBack to top Except where otherwise noted, content on this wiki is licensed under the following license: CC If so, how do I get it in there? Main Menu LQ Calendar LQ Rules LQ Sitemap Site FAQ View New Posts View Latest Posts Zero Reply Threads LQ Wiki Most Wanted Jeremy's Blog Report LQ Bug Syndicate Latest Typeerror: 'frozenset' Object Is Not Callable Apache can't load mod_python.so --------------------------------------------- This more common problem on Windows, but can occur on other platforms.
Also, show the full error messages appearing around the make_obcallback error in the logs. Centos 7 Mod_python The OP's problem occurred when python was updated to 2.4.3-46.el5_8.2. ~0015604 spkane (reporter) 2012-08-08 15:48 Actually, I had rolled back the python release since it broke the system pretty badly. After upgrading to 5.8 my Nagios setup does not serve any webpages any more. http://www.linuxquestions.org/questions/linux-software-2/apache-mod_python-problem-importerror-no-module-named-mod_python-apache-587837/ Registration is quick, simple and absolutely free.
I.e., it seems as if the module is not being re-loaded for each request, which is what I thought was the implication for MaxRequestsPerChild = 1. 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 > > where you pointed --prefix to in the configure step). Description : Python is an interpreted, interactive, object-oriented programming language often compared to Tcl, Perl, Scheme or Java.
mod_python works.TagsNo tags attached.Attached Files Relationships Relationships Notes ~0015353 range (administrator) 2012-06-30 17:49 Do you have a python script which can be used to recreate this issue? All the same, all this extra information should hopefully be enough for people to see there is a misconfiguration problem and work out what is missing or wrongly installed. Error Make_obcallback Could Not Import Mod_python.apache. N They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Centos Mod_python When it goes to import "mod_python.apache" when a request is first received, if it cannot be found, it will dump out Python path that was used in the search: [Mon Apr
I.e., first time, yes. 2nd time, no, etc. Perhaps others are using Python2.6 with the distro mod_python-3.3.1 built for it, and not mod_python-3.2.8. ~0015654 spkane (reporter) 2012-08-14 22:07 This can likely be closed. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import mod_python.apache Traceback (most recent call last): File "
There's the official site and there's a link from the Django site...the one from the Django site doesn't work Octal - All your base-8 belong to us "Knowing is not enough, File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/ mod_python/apache.py", line 28, in ? build 1495)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import mod_python.apache Traceback (most recent call last): File "
random.py: return (long(_hexlify(_urandom(7)), 16) >> 3) * RECIP_BPF random.py: x = long(_hexlify(_urandom(bytes)), 16) urllib2.py: # Use /dev/urandom if it is available. Graham Mar 31 '08 #2 This discussion thread is closed Start new discussion Replies have been disabled for this discussion. Suggestions of other stuff to output and when, most welcome.
Register FAQ/Rules My SitePoint Forum Actions Mark Forums Read Quick Links View Forum Leaders Remember Me? make_obcallback: could not import mod_python.apache -------------------------------------------------------------------------- This one seems to occur on all platforms with similar frequency, and is usually related to having python multiple versions on the same system. Typical error message: [Sun Apr 09 14:03:46 2006] [error] make_obcallback: could not import mod_python.apache.\n [Sun Apr 09 14:03:46 2006] [error] python_handler: no interpreter callback found. [Sun Apr 09 14:03:46 2006] [error] The candidates missing DLLs are python24.dll and the Microsoft Runtime DLLS (normally msvcr71.dll and msvcp71.dll).
The simple solution is to set an env var PYTHONHOME to the base of the python install (i.e. Restarting httpd did not help. Python supports interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac and MFC). import tempfile File "/usr/lib64/python2.4/tempfile.py", line 33, in ?
Assuming you have installed correctly the mod_python (regarding the python version, etc), you must do the following: check the permissions for mod_python folder under /usr/lib/python2.5 (or wherever you installed it) ls I did have /usr/local/bin/python2.4.old, but moving that and its libs didn't help. Note that documentation for Python is provided in the python-docs package. # rpm -V python-2.4.3-46.el5_8.2 # rpm -V python-libs-2.4.3-46.el5_8.2 # /usr/bin/python -v # installing zipimport hook import zipimport # builtin # Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community.
This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. 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. 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. Dowgrade to python-2.4.3-46.el5.i386.
If I set it to 1, however, the same thing happens. from random import Random as _Random File "/usr/lib64/python2.4/random.py", line 46, in ? The runtime DLLs are normaly copied in your Python directory, so putting the Python directory on your PATH variable should do the trick. All this output should hopefully eliminate a lot of issues down the track.
apache), run these simple commands: chmod 777 /usr/lib/python2.5/site-packages/mod_python chmod 666 /usr/lib/python2.5/site-packages/mod_python/* Restart the apache and here you go! from os import urandom as _urandom ImportError: cannot import name urandom [Sat Jun 30 12:01:19 2012] [error] make_obcallback: Python path being used "['/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/gtk-2.0']". [Sat Like this:Like Loading... This package contains most of the standard Python modules, as well as modules for interfacing to the Tix widget set for Tk and RPM.
Interestingly, if I run httpd -X directly, it works no problem. And this is my place to share these things with the world!! :-) Powerball Record: 13,014 RPMSet: 16th October 2008 Daily Press-ups: 135 reps Since initially: 45 reps in March 2004 By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. 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.
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