title: Using local package repository instead of public pypi for setuptools in virtualenv
body: <p>I have a virtualenv where I am installing a number of packages from pip using an intranet repository (the machine does not have internet access). I have a <code>pip.conf</code> in the virtualenv directory and pip uses this without issue. However, there is one package with a <code>setup.py</code> file using the <code>setup_requires</code> option. Since this does not use pip but rather easy_install to grab dependencies, it does not use the repository specified in the virtualenv's <code>pip.conf</code> (see <a href="https://pip.pypa.io/en/stable/reference/pip_install/#controlling-setup-requires" rel="nofollow noreferrer">https://pip.pypa.io/en/stable/reference/pip_install/#controlling-setup-requires</a>).</p>
  
  <p>The apparent solution to this is to create a distutils configuration file to specify the intranet repository I want to use. </p>
  
  <p>This worked ok when I created a user-specific config file at <code>~/.pydistutils.cfg</code>, however this is not a portable solution as I can't be overwriting files in my colleagues' home directories whenever they use my virtualenv. I was hoping to be able to specify the distutils configuration inside the virtualenv itself, but I can't seem to figure out how to do this.</p>
  
  <p>The distutils configuration document seemed to suggest that I could put a file here:</p>
  
  <p><code>prefix/lib/pythonver/distutils/distutils.cfg</code>, however this did not appear to work for me.</p>
  
  <p>The contents of this config is essentially:</p>
  
  <pre><code>[easy_install]
  allow_hosts = internalhostname
  index_url = http://internalhostname/artifactory/api/pypi/pypi/simple
  </code></pre>
  
  <p>I am actually using setuptools in my virtualenv, but a lot of the documentation for setuptools seems to refer to distutils configuration (e.g. see <a href="http://setuptools.readthedocs.io/en/latest/easy_install.html#configuration-files" rel="nofollow noreferrer">http://setuptools.readthedocs.io/en/latest/easy_install.html#configuration-files</a>)</p>
  
  <p>How can I have setuptools within the virtualenv use a specific package repository without requiring a user-specific or system-wide configuration change?</p>