[mod_python] undefined symbol: PyThread_acquire_lock

Graham Dumpleton graham.dumpleton at gmail.com
Tue Jul 8 21:56:31 EDT 2008


2008/7/9 David AnguloJunk <davidangulojunk at gmail.com>:
> Re: apache startup.  I sent this earlier, but accidently cut off the
> CC for the list, so I'll repost it
>
> ===========
> Does this mean that the mod_python hasn't been installed correctly:
>
>   [/home/x/public_html/conf]# python
>   Python 2.3.4 (#1, Dec 11 2007, 05:27:57)
>   [GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2
>   Type "help", "copyright", "credits" or "license" for more information.
>   >>> import mod_python.psp
>
>   Traceback (most recent call last):
>     File "<stdin>", line 1, in ?
>   ImportError: No module named mod_python.psp

Of course, you ran Python 2.3 and not Python 2.5.

> Also, I found this in the apache log:
>
>   [Thu Jul  3 15:43:35 2008] [notice] Apache/1.3.39 (Unix)
>   PHP/5.2.5 mod_python/2.7.11 Python/2.5.1
>   mod_auth_passthrough/1.8 mod_bwlimited/1.4
>   mod_log_bytes/1.2 mod_gzip/1.3.26.1a FrontPage/5.0.2.2635
>   DAV/1.0.3 mod_ssl/2.8.30 OpenSSL/0.9.7a configured --
>   resuming normal operations

Is there any chance you can upgrade to Apache 2 and latest mod_python.
Version 2.7.11 is no longer supported and not guaranteed to even work
on latest versions of Python.

> Re: Python shared library.  No, a shared library isn't being used:
>
> x at y [~]# ldd mod_python.so
> ldd: ./mod_python.so: No such file or directory
> x at y [~]# ls -las mod_pyhthon.so
> /bin/ls: mod_pyhthon.so: No such file or directory

Run in wrong directory, so this says nothing.

Obviously you should have run it with full path to mod_python.so if
not in same directory.

At this point, if you really want to use Apache 1.3 and are wanting to
host a WSGI capable application, eg, Django, Trac, TurboGears, Pylons
etc, then try mod_wsgi instead.

Importantly, read all the warnings in mod_wsgi documentation about
Python shared libraries.

  http://code.google.com/p/modwsgi/wiki/InstallationIssues

and perhaps fix your Python installation so it will all perform better anyway.

Graham

> but that's going to depend on which directory I'm in when I run it so:
>
> x at y [~]# locate mod_python.so
> /usr/local/apache/libexec/mod_python.so
> /usr/src/mod_python-2.7.11/src/mod_python.so
> x at y [~]# ls -las /usr/local/apache/libexec/mod_python.so
> 3951 -rwxr-xr-x  1 root root 4028236 Jan 16 14:48
> /usr/local/apache/libexec/mod_python.so*

That is big, so not using Python shared library.

> On 7/7/08, Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
>> What does Apache startup message say about mod_python version:
>>
>> [Tue Feb 01 16:08:21 2005] [notice] Apache/2.0.51 (Unix)
>>   mod_python/3.1.3 Python/2.3 configured -- resuming normal operations
>>
>> Is a Python shared library being used. Ie., what do you get if do:
>>
>>   ldd mod_python.so
>>
>> and:
>>
>>   ls -las mod_pyhthon.so
>>
>> Graham
>>
>> 2008/7/8 David Angulo Junk <DavidAnguloJunk at gmail.com>:
>>> Thanks again.
>>>
>>> The installations are at:
>>>
>>> /usr/bin/python2.3
>>> /usr/local/bin/python2.4
>>> /usr/local/bin/python2.5
>>>
>>> and the libraries are at:
>>>
>>> /usr/lib/python2.3/
>>> /usr/local/lib/python2.4/
>>> /usr/local/lib/python2.5/
>>>
>>> No, I don't see any installation in both places.
>>>
>>>
>>> So, from what you said below, I take it I should uninstall some versions
>>> and
>>> ensure they're all installed in a single location???
>>>
>>> Thanks.
>>>
>>> Dave
>>>
>>>
>>>
>>> On Thu, Jul 3, 2008 at 7:53 PM, Graham Dumpleton
>>> <graham.dumpleton at gmail.com> wrote:
>>>>
>>>> Please keep followups on list by using reply-all.
>>>>
>>>> 2008/7/4 David AnguloJunk <davidangulojunk at gmail.com>:
>>>> > I walked into an installation done by someone else.  There are three
>>>> > pythongs installed (2.3, 2.4, and 2.5).  I do not see anything setting
>>>> > paths
>>>> > to any of the three of these in either the httpd.conf  nor in the
>>>> > environment variables.  Where are the "python paths" set?  I am
>>>> > assuming
>>>> > that mod_python just has its path set into it at install time??
>>>>
>>>> But where are the different versions installed? Are there some in /usr
>>>> and some in /usr/local and is any version appearing in both locations.
>>>>
>>>> How mod_python finds Python installation is a bit convoluted, albeit
>>>> not mod_python's fault, but just how Python does it. Effectively, the
>>>> version of Python is known by mod_python by virtue of library being
>>>> linked in, but run time directories for Python found at run time,
>>>> which can cause problems if you have Python installations in multiple
>>>> different root directories.
>>>>
>>>> Graham
>>>>
>>>> > Thanks for your help.
>>>> >
>>>> > Dave
>>>> >
>>>> > On Tue, Jul 1, 2008 at 9:32 PM, Graham Dumpleton
>>>> > <graham.dumpleton at gmail.com> wrote:
>>>> >>
>>>> >> Did you have to heavily fiddle with Python paths to get mod_python to
>>>> >> use the installation of Python you wanted it to use? Looks a bit like
>>>> >> you are trying to use a Python installation different to what
>>>> >> mod_python was compiled for.
>>>> >>
>>>> >> Graham
>>>> >>
>>>> >> 2008/7/2 David AnguloJunk <davidangulojunk at gmail.com>:
>>>> >> > Could someone help me please?  In my code, I'm doing a:
>>>> >> >
>>>> >> >     import zlib
>>>> >> >
>>>> >> > and I get this:
>>>> >> >
>>>> >> >    Mod_python error: "PythonHandler www"
>>>> >> >
>>>> >> >    Traceback (most recent call last):
>>>> >> >
>>>> >> >      File
>>>> >> > "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
>>>> >> > line 181, in Dispatch
>>>> >> >
>>>> >> >        module = import_module(module_name, _req)
>>>> >> >      File
>>>> >> > "/usr/local/lib/python2.5/site-packages/mod_python/apache.py",
>>>> >> > line 335, in import_module
>>>> >> >        module = imp.load_module(mname, f, p, d)
>>>> >> >      File "/home/x/public_html/www/modules/www.py", line 8, in
>>>> >> > <module>
>>>> >> >
>>>> >> >        import google_sitemap
>>>> >> >      File "/home/x/public_html/www/modules/google_sitemap.py",
>>>> >> > line 2,
>>>> >> > in <module>
>>>> >> >        import gzip
>>>> >> >      File "/usr/local/lib/python2.5/gzip.py", line 9, in <module>
>>>> >> >
>>>> >> >        import zlib
>>>> >> >    ImportError: /usr/local/lib/python2.5/lib-dynload/zlib.so:
>>>> >> > undefined
>>>> >> > symbol: PyThread_acquire_lock
>>>> >> >
>>>> >> > Thanks
>>>> >> >
>>>> >> > _______________________________________________
>>>> >> > 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