0

I've been trying to install mod_wsgi configured for Python 3.2 on a CentOS machine and I keep running into the error:

/usr/bin/ld: cannot find -lpython3.2

As near as I can tell this is caused by a missing libpython3.2.so or equivalent, but I can't seem to figure out how to create that file.

Some pertinent data:

  1. The Python install is 3.2, downloaded from python.org as a tar.bz2
  2. The md5sum of Python-3.2.tar.bz2 matches the one on Python.org
  3. This problem happens both with the version of mod_wsgi from the hg repository and from mod_wsgi-3.3.tar.gz

(I do realize this could also be a serverfault question, but this seemed like the more intuitive forum).

(Output below for reference)

[root@<>mod_wsgi-3.3]# ./configure PYTHON=/usr/local/bin/python3.2
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.3
configure: creating ./config.status
config.status: creating Makefile
[root@<> mod_wsgi-3.3]# make
... (I will include this if requested, but it makes it easier to 
    read if this is removed)
mod_wsgi.c:7154: warning: 'wsgi_set_py3k_warning_flag' defined but not used
mod_wsgi.c:7856: warning: 'wsgi_set_user_authoritative' defined but not used
mod_wsgi.c:14414: warning: 'wsgi_hook_check_user_id' defined but not used
/usr/lib/apr-1/build/libtool --silent --mode=link gcc -o mod_wsgi.la  -rpath /usr/lib/httpd/modules -module -avoid-version    mod_wsgi.lo -L/usr/local/lib
-L/usr/local/lib/python3.2/config -lpython3.2 -lpthread -ldl -lutil -lm
/usr/bin/ld: cannot find -lpython3.2
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1
[root@<> mod_wsgi-3.3]#
Hennes
  • 65,804
  • 7
  • 115
  • 169

1 Answers1

0

If you built Python 3.2 with:

./configure --enable-shared; make; make install

as you say, then that would actually have installed under /usr and not under /usr/local. Thus it would look like you may have two Python installations for 3.2 and your PATH or the PYTHON settings means you are picking up the one under /usr/local and not the one that got installed under /usr based on your configure settings for Python. Work out how many Python installations you actually have, where and what versions. Also make sure that when you are rebuilding source code for either Python or mod_wsgi that you do:

make distclean

between builds to ensure you don't have anything left from previous builds from a prior configuration.

Note that it is preferable to edit your original question to add extra information and not only add it in comments where it is hard to find.