[mod_python] Import problem with math.so

Alain Tesio alain at onesite.org
Fri Jan 18 21:10:28 EST 2002


Hi, from time to time I get this error, top fix it I must go
to the modpython src dir and run make && make install.

Mod_python error: "PythonHandler observer_www"

Traceback (most recent call last):

  File "/usr/local/lib/python2.1/site-packages/mod_python/apache.py", line 181, in Dispatch
    module = import_module(module_name, _req)

  File "/usr/local/lib/python2.1/site-packages/mod_python/apache.py", line 338, in import_module
    module = imp.load_module(mname, f, p, d)

  File "/home/observer/scripts/observer_www.py", line 13, in ?
    import wwwlib

  File "/home/observer/scripts/wwwlib.py", line 1, in ?
    import mycgi

  File "/home/observer/scripts/mycgi.py", line 9, in ?
    import math

ImportError: /usr/lib/python2.1/lib-dynload/math.so: undefined symbol: PyFPE_jbuf


However ldd gives only shared libs in the standard path:

05:53:18 observer ~/scripts $ldd /usr/lib/python2.1/lib-dynload/math.so
        libm.so.6 => /lib/libm.so.6 (0x40009000)
        libc.so.6 => /lib/libc.so.6 (0x4002b000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

I can import the module from the interpreter:

05:53:34 observer ~/scripts $python
Python 2.1.1 (#2, Jan 13 2002, 17:07:14)
[GCC 2.95.4 20011006 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import math
>>>

The configure line is:

../configure --with-apxs=`which apxs` --with-python=/usr/src/Python-2.1.1

and the compilation commands:

/usr/bin/apxs -I/usr/src/mod_python-2.7.6/src/include -I/usr/include/apache-1.3 -I/usr/src/Python-2.1.1 -I/usr/src/Python-2.1.1/Include -c mod_python.o _apachemodule.o requestobject.o tableobject.o util.o serverobject.o connobject.o  -lm  /usr/src/Python-2.1.1/libpython2.1.a   -ldl  -lutil   -lm           -lreadline -ltermcap
gcc -shared -o mod_python.so mod_python.o _apachemodule.o requestobject.o tableobject.o util.o serverobject.o connobject.o -lm /usr/src/Python-2.1.1/libpython2.1.a -ldl -lutil -lm -lreadline -ltermcap -lc -lm -lcrypt -ldb1 -ldb


Another similar error I can't explain, fixed the same way is with one of
my modules:

>   File "/home/observer/scripts/observer_www.py", line 18, in handler
>     form_items=wwwlib.mod_python_form_items(req)
> 
> AttributeError: 'wwwlib' module has no attribute 'mod_python_form_items'



Any idea ?

Thanks
Alain



More information about the Mod_python mailing list