title: Problems installing Python 3 with --enable-shared
body: <h2>Problem</h2>
  
  <p>I'm trying to install Python 3 with the --enable-shared option. Installation "succeeds" but the resulting Python is not runnable. Trying to run Python after installation gives the following error:</p>
  
  <pre><code>$ /opt/python3/bin/python3.5
  /opt/python3/bin/python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
  </code></pre>
  
  <h3>Background</h3>
  
  <p>The OS is Debian (squeeze), and has a previous installation of Python 2.6, which is necessary to retain because other code relies on it, and Apache 2.2. Ultimately what I'm trying to do is set up Django to run on Apache, meaning I'm trying to install mod_wsgi (or mod_wsgi-express), which requires shared libraries. I have already tried to install mod_wsgi <em>without</em> using <code>--enable-shared</code> in the Python installation, and have gotten... well, the same thing, but this time from the mod_wsgi installer (and from <code>pip install mod_wsgi</code>, which I also tried): <code>/opt/python3/bin/python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory</code>.</p>
  
  <h2>Trace</h2>
  
  <p>Starting from an installation as described in <strong>Background</strong> above, here is the minimum list of commands I've executed that produce the error above (with verbosity removed).</p>
  
  <pre><code>user@server:~$ wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
  user@server:~$ tar -zxvf Python-3.5.1.tgz
  user@server:~$ cd Python-3.5.1
  user@server:~/Python-3.5.1$ ./configure --prefix=/opt/python3 --enable-shared
  user@server:~/Python-3.5.1$ make &amp;&amp; sudo make install
  (... appears to install correctly)
  
  user@server:~/Python-3.5.1$ /opt/python3/bin/python3.5
  /opt/python3/bin/python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>I have also tried this with <code>LD_RUN_PATH</code> set as described in the solution to this <a href="https://stackoverflow.com/questions/22157184/strange-python-compilation-results-with-enable-shared-flag">other question</a>, with the same results:</p>
  
  <pre><code>user@server:~/Python-3.5.1$ sudo make distclean
  user@server:~/Python-3.5.1$ ./configure --prefix=/opt/python3 --enable-shared
  user@server:~/Python-3.5.1$ LD_RUN_PATH=/usr/local/lib make
  user@server:~/Python-3.5.1$ sudo make install
  user@server:~/Python-3.5.1$ /opt/python3/bin/python3.5
  /opt/python3/bin/python3.5: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>I have also tried this with Python 3.4, with the same results. I have not tried this with Python 2, because I do not want future development to be limited to Python 2.7 (therefore even a successful installation would not satisfy my requirements). I'm also assuming the attempt would not provide any new or useful information.</p>