title: Installing local packages with Python virtualenv --system-site-packages
body: <p>I know this topic has been beat to death but I have not been able to find a solution to the problem I'm having on SO or elsewhere, so I suspect that there may be a bug somewhere in my system.</p>
  
  <p>I am on an older RHEL 6 platform with Python 3.4. I am developing an application that will run on this platform that uses Qt. I've installed all of the relevant libraries via <code>yum</code> (e.g. <code>qt-devel</code>, <code>pyqt4-devel</code>, etc.) and now want to install my application package as an "editable" package using <code>pip install -e mypkg</code>. I also have a couple of dependency requirements that are not on <code>yum</code> and must be installed via <code>pip</code>.</p>
  
  <p>What I would like to do is create a virtualenv that "inherits" the system packages installed via <code>yum</code> but allows me to <code>pip install</code> my own packages into a virtualenv directory in my home directory.</p>
  
  <p>From my Googling it looks like the best way to do this is to create a virtual env with the system's site packages directory:</p>
  
  <pre class="lang-sh prettyprint-override"><code>$ python3 -m venv --system-site-packages ~/venv
  </code></pre>
  
  <p>However, when I try to install a package to this virtualenv's site-packages directory, it attempts to install it under <code>/usr/lib</code> and I get a <code>Permission denied</code> error.</p>
  
  <p>So it appears that the <code>--system-site-packages</code> option makes my virtualenv completely share the site-packages directory from my system instead of using it as a "base", where further packages can be layered on top.</p>
  
  <p><a href="https://stackoverflow.com/questions/12079607/make-virtualenv-inherit-specific-packages-from-your-global-site-packages/19459977">This answer</a> states that using <code>pip install -I</code> should do what I want, but that does not appear to be the case:</p>
  
  <pre class="lang-sh prettyprint-override"><code>(venv) $ pip3 install -I bitstring
  ...
  error: could not create '/usr/lib/python3.4/site-packages/bitstring.py': Permission denied
  </code></pre>