Where does pip install its modules? What if using a virtualenv? Also getting an error setting up mod_wsgi
<p>I am new to Python and there are some things which I am not able to apprehend. Questions may seem like very kiddish, so bear with me. </p>

<p>As you know, Ubuntu comes with an outdated Python version. I wished to use the latest python. But since it is recommended not to override the system's python, I installed <code>virtualenv</code>.</p>

<p>I installed <code>pip</code> first, using <code>sudo apt-get install python-pip</code>.</p>

<p>Then installed <code>virtualenv</code>, using <code>sudo pip install virtualenv</code>, and did all the configurations required to link it to the latest python. </p>

<p>The questions which I want to ask are-</p>

<ol>
<li><p>Where does the command <code>pip install &lt;module&gt;</code> store the module in the system? I am asking this question because there is a section in this <a href="https://pypi.python.org/pypi/mod_wsgi" rel="nofollow">link</a>, which says "Installation into Python". I was confused by this, thinking whether installing a python module is sensitive to which python version I am using. If it is so, then where does <code>pip</code> install the module if I am using <code>virtualenv</code> and otherwise. </p></li>
<li><p>I have manually installed Apache HTTP Server 2.4.23 using this <a href="https://ksmanisite.wordpress.com/2016/10/05/manually-install-apache-http-server-in-ubuntu/" rel="nofollow">link</a>. While installing <code>mod_wsgi</code> using command <code>sudo pip install mod_wsgi</code>, I am getting this error</p>

<blockquote>
  <p>RuntimeError: The 'apxs' command appears not to be installed or is not
  executable. Please check the list of prerequisites in the
  documentation for this package and install any missing Apache httpd
  server packages.</p>
</blockquote></li>
</ol>

<p>I searched for it and the solution is to install developer package of Apache. But the problem is that I am not able to find it anywhere on it's site. I want to install it manually. What to do? Also, If I install it through <code>sudo apt-get install apache2-dev</code>, Will there be any difference ? </p>

<p>Note: As mentioned on this <a href="https://pypi.python.org/pypi/mod_wsgi" rel="nofollow">link</a>, I have already set the value of <code>APXS</code> environment variable to the location of <code>apxs</code> script, which is <code>/usr/local/apache/bin/apxs</code>. </p>

<p>Concerning 1., if I have well understood, you would like to have the last 2.7 or 3.5 Python version on your distribution. Actually, you can have multiple python distribution on your distribution. I would suggest you to have a look on conda/anaconda (<a href="https://www.continuum.io/downloads" rel="nofollow">https://www.continuum.io/downloads</a>) : it is very powerful and i think it would better suit you than virtualenv: virtualenv would enable you to create a separate python environnement, but it would not install a newer version of Python.</p>

<p>Concerning 2, I am not an expert in Apache2, but I would have used apt-get instead of re-compiling apache. While compiling, you may need some dependancies to build the mod_wsgi module. So I think it is way more easy to use the pre-built packages from your ubuntu. </p>

python apache ubuntu mod-wsgi