Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Ubuntu 12.04, I am trying to compile and install Python3.3.2. My compile commands:

./configure --prefix=/usr/local --enable-shared
make install

Then I run:

/usr/local/bin/python3.3 --version

and get:

python3: error while loading shared libraries: cannot open shared object file: No such file or directory

If I build without --enable-shared, everything runs fine, but I need the shared option to compile mod_wsgi against it.

I do find in the /usr/local/lib folder, so I wonder if it is just looking in the wrong place. Do I need to do a symlink from somewhere?

share|improve this question
Close voters, this is a XY situation, OP wants mod_wsgi and tries to compile it himself instead installing the Ubuntu package that is already compiled. – Braiam Sep 20 '13 at 19:40

Don't know why you want to build mod_wsgi using the sources, but isn't more easier installing the deb packages?

sudo apt-get install libapache2-mod-wsgi

or if you want python 3 version:

sudo apt-get install libapache2-mod-wsgi-py3

apt-cache show libapache2-mod-wsgi-py3:

Python 3 WSGI adapter module for Apache The mod_wsgi adapter is an Apache module that provides a WSGI (Web Server Gateway Interface, a standard interface between web server software and web applications written in Python) compliant interface for hosting Python based web applications within Apache. The adapter provides significantly better performance than using existing WSGI adapters for mod_python or CGI. This package provides a module for Python 3.X.

share|improve this answer
So compile without --enable-shared and just use these? They work with python3.3? – Luke Sep 20 '13 at 19:07
You don't need to compile anything, is already compiled for you to use. – Braiam Sep 20 '13 at 19:10
I mean compiling Python 3.3, because that's what was giving me the errors. Since I can use apt-get for the mod-wsgi, is there any reason to keep the --enable-shared on the Python 3.3 compilation? – Luke Sep 20 '13 at 21:14
You don't need to compile python, you already will have mod-wsgi which is your final propose. You can delete the compiled python for all I can know. – Braiam Sep 20 '13 at 21:23
Alright, thanks man! I'll try to get a new VM fired up next week and give it a shot. – Luke Sep 20 '13 at 21:31

Your Answer


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.