title: Pip install requirements.txt in venv: How to ignore system site packages of different version?
body: <p>I am in a virtual environment which shares the system site packages (created with <code>venv</code> in Python 3.5), and I would like to install all packages in a given requirements.txt into this venv. The system-wide python installation is read-only, so I cannot modify it.</p>
  
  <p>Now, for example, my requirements.txt lists, among many others,</p>
  
  <pre><code>SomePackage==2.0
  </code></pre>
  
  <p>as requirement, while the system installation already contains <code>SomePackage-1.0</code>. Pip thus tries to uninstall <code>SomePackage-1.0</code> to upgrade to version 2.0. This, however, fails because the system-wide python installation is read-only.</p>
  
  <p>Is there a way to run <code>pip install -r requirements.txt</code> in a way that ignores installed packages if they have a different version from the required one and just installs the required version into the venv?</p>
  
  <p>I guess this would be similar to installing each package one by one and using <code>--ignore-installed</code> whenever the package is already present in a different version than the required one. This, however, seems quite cumbersome. Is there a better way?</p>
  
  <p>Note that I am using a venv with shared system site packages because I want to avoid the installation of several huge packages each time I create a new venv. Thus I do not want to switch to a fully isolated venv, which would, of course, not have the above issue.</p>
  
  <p>Any hint would be greatly appreciated! Thanks a lot!</p>