Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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]#
share|improve this question
    
Can you list the files under /usr/local/lib/python3.2/config in your post? –  John T Sep 1 '11 at 17:23
    
It does not seem to be there... Was this an install directive I missed? –  cwallenpoole Sep 1 '11 at 17:28
    
The makefile is looking for a config in that directory for the linker (ld). You can modify the makefile to point to your Python install or re-install python under the standard directory. –  John T Sep 1 '11 at 18:06
    
How would I go about finding out how to do that? (I'm just using ./configure --enable-shared; make; make install for the Python install) –  cwallenpoole Sep 1 '11 at 18:39
    
What are all the actual 'configure' arguments you supplied when building Python? For mod_wsgi, to indicate where Python installed, you are supposed to use --with-python option and not set PYTHON variable when running configure. –  Graham Dumpleton Sep 1 '11 at 20:16

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.