title: Can't load mod_wsgi compiled for Python 3
body: <p>I'm on CentOS and trying to configure Apache to use mod_wsgi compiled against Anaconda Python 3.5. Compiling mod_wsgi <em>seems</em> to go OK:</p>
  
  <pre><code>sudo yum install httpd-devel
  sudo ./configure --with-python=/opt/anaconda/anaconda3/bin/python
  sudo make
  
  ls -l /etc/httpd/modules/mod_wsgi.so
  -rwxr-xr-x. 1 root root 702205 Mar  2 23:12 /etc/httpd/modules/mod_wsgi.so
  </code></pre>
  
  <p>But when I start the web server it can't seem to find its libraries:</p>
  
  <pre><code>sudo service httpd start
  Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf:
  Syntax error on line 1 of /etc/httpd/conf.d/wsgi.conf: Cannot load
  /etc/httpd/modules/mod_wsgi.so into server: libpython3.5m.so.1.0: cannot
  open shared object file: No such file or directory
  </code></pre>
  
  <p><code>libpython3.5m.so.1.0</code> is definitely in <code>/opt/anaconda/anaconda3/lib</code>, so I suppose the <code>mod_wsgi.so</code> module doesn't know where to look for it. Yet the mod_wsgi <code>config.status</code> seems to confirm that</p>
  
  <pre><code>S["LDFLAGS"]=" -L/opt/anaconda/anaconda3/lib -L/opt/anaconda/anaconda3/lib/python3.5/config-3.5m "
  </code></pre>
  
  <p>so I'm at a loss... Can anyone point me in the right direction?</p>
  
  <p>EDIT: OK, thanks to @mata, I think I've compiled mod_wsgi against the correct libraries. But now the server logs just fill up with the same repeated message:</p>
  
  <pre><code>Current thread 0x00007f60d68d07e0 (most recent call first):
  Could not find platform independent libraries &lt;prefix&gt;
  Could not find platform dependent libraries &lt;exec_prefix&gt;
  Consider setting $PYTHONHOME to &lt;prefix&gt;[:&lt;exec_prefix&gt;]
  Fatal Python error: Py_Initialize: Unable to get the locale encoding
  ImportError: No module named 'encodings'
  </code></pre>
  
  <p>So I'm guessing apache is looking in the wrong place for the python libraries. The <code>00-wsgi.conf</code> file giving all the trouble reads:</p>
  
  <pre><code>WSGIPythonHome /opt/anaconda/anaconda3
  WSGIPythonPath /opt/anaconda/anaconda3/lib/python3.5/site-packages
  LoadModule wsgi_module modules/mod_wsgi.so
  </code></pre>
  
  <p>so I thought (from what I've read on other threads about this) that I'd told it where to look for my Python install.</p>