[mod_python] trying to upgrade to Python2.4, Apache2.0.53, Mod_Python3.1.4 on Mac OsX

John Raines jrraines at comcast.net
Tue Feb 15 18:22:32 EST 2005


My website had been stable and running without error but I'd been 
running on 2.3.3, 2.0.52 and 3.1.3; since everything was behind the 
times I decided to finally reinstall; I made the mistake of doing it on 
the drive that everything was being served off of instead of using my 
backup drive. :-(

I installed python 2.4 and it seems to work when I call it from the 
shell. I did not do a frameworkInstall, which seems to be recommended 
by some people. I am too much of a unix novice to understand what the 
implications of frameworkInstall are. I installed apache and mod_python 
as follows:

cd ~/Desktop/httpd-2.0.53
./configure --enable-so --with-mpm=worker
make
sudo make install

cd ~/Desktop/mod_python-3.1.4
./configure --with apxs=/usr/local/apache2/bin/apxs 
--with-python=/usr/local/bin/python2.4
make
sudo make install

I restored my old httpd.conf file and my website files. My index.html 
file is straight html which links to .py files. As soon as I try to 
access any of the .py stuff I now get an internal server error message 
and the server log shows this:

[Tue Feb 15 16:25:25 2005] [notice] mod_python: Creating 32 session 
mutexes based on 6 max processes and 25 max threads.
[Tue Feb 15 16:25:25 2005] [notice] Apache configured -- resuming 
normal operations
[Tue Feb 15 16:25:36 2005] [error] make_obcallback: could not import 
mod_python.apache.\n
Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/mod_python/apache.py", 
line 22, in ?
     import time
ImportError: Failure linking new module: : dyld: 
/usr/local/apache2/bin/httpd Undefined symbols:
/usr/local/lib/python2.4/lib-dynload/time.so undefined reference to 
_PyArg_Parse expected to be defined in the executable
/usr/local/lib/python2.4/lib-dynload/time.so undefined reference to 
_PyArg_ParseTuple expected to be defined in the executable
/usr/local/lib/python2.4/lib-dynload/time.so undefined reference to 
_PyDict_GetItemString expected to be defined in the executable
/usr/local/lib/python2.4/lib-dynload/time.so un                         
                                                              <--what 
happened here??
[Tue Feb 15 16:25:36 2005] [error] make_obcallback: could not import 
mod_python.apache.

for what its worth I can access various parts of the time module when I 
run Python2.4 from the shell.

Going back through the the mailing list I saw that Graham Dumpleton 
(back on Dec 23) suggested the output from this might be useful; what I 
get is different from what he saw but I'm not sure what to make of my 
result:

jraines-Computer:~/Desktop/Website jrraines$ otool otool -L 
/usr/local/apache2/modules/mod_python.so
otool: can't open file: otool (No such file or directory)
/usr/local/apache2/modules/mod_python.so:
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, 
current version 71.1.1)

jraines-Computer:~/Desktop/Website jrraines$ ls 
/usr/local/apache2/modules
httpd.exp       mod_python.so

My problem seemed like it might be similar to a thread titled Weird 
ob_callback problems at the end of Jan. I tried the suggestions Grisha 
made:Try defining DYLD_FORCE_FLAT_NAMESPACE=1 environment variable 
before launching httpd.
That didn't help either.



More information about the Mod_python mailing list