title: Python - Virtual Environment uses System Directories
body: <p>I've created a Python virtual environment, and activate it by doing:</p>
  
  <pre><code>joe@joe-mint $ source ./venvs/deep-learning/bin/activate
  </code></pre>
  
  <p>Which turns the prompt into:</p>
  
  <pre><code>(deep-learning) joe@joe-mint $
  </code></pre>
  
  <p>Now whenever I run a python package or try to install one, the system seems to ignore the fact that it's in a virtual environment and does things system-wide:</p>
  
  <pre><code>(deep-learning) joe@joe-mint $ which pip
  /usr/local/bin/pip
  </code></pre>
  
  <p>The same happens when I try to install new packages that aren't on my system; it installs them to the system files (i.e. /usr/bin) instead of the virtual environment.</p>
  
  <p>What's wrong with my virtual environment? How do I get it to ignore system files and do everything inside the environment?</p>
  
  <hr>
  
  <p>I've looked at <a href="https://stackoverflow.com/questions/21240653/how-to-install-a-package-inside-virtualenv">this</a> question which says to use an explicit flag when creating the virtual environment to make it use the local environment packages, but I used <code>python-3.5 -m venv</code> to create the virtual environment, and this flag is removed in this version as it's now a default option.</p>
  
  <p>I've also looked at <a href="https://stackoverflow.com/questions/24011399/activating-a-virtual-env-not-working">this</a> question and can confirm that the <code>VIRTUAL_ENV</code> variable is set correctly in the <code>activate</code> file of the virtual environment.</p>