title: Local copy of PyPI fro Python
body: <p>I need to deploy a replica of PyPI on an internal network. The idea is to have all the PyPI  packages in the local repository, avoiding to connect to the real PyPI repo all the time.</p>
  
  <p>I used <a href="https://pypi.python.org/pypi/bandersnatch" rel="nofollow noreferrer">bandersnatch</a> to mirror the files of PyPI accoring to PEP381.
  Than on clients' pip I dropped /etc/pip.conf as following</p>
  
  <pre><code>[global]
  index-url = http://www.myserver.com/repo/PyPI/web/simple
  trusted-host = www.myserver.com
  </code></pre>
  
  <p>On the clients machine the command:</p>
  
  <pre><code>pip install -v &lt;some packages&gt; 
  </code></pre>
  
  <p>works using the local repo. However the command</p>
  
  <pre><code>pip search --index http://www.myserver.com/repo/PyPI/web/simple &lt;some packages&gt;
  </code></pre>
  
  <p>doesn' t work and returns</p>
  
  <pre><code>raise HTTPError(http_error_msg, response=self)
  pip._vendor.requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://www.myserver.com/repo/PyPI/web/ 
  </code></pre>
  
  <p>Here are 2 questions:</p>
  
  <ol>
  <li><p>Is it possible to enable the pip search command without install a local PyPI server such as <a href="https://pypi.python.org/pypi/pypiserver" rel="nofollow noreferrer">pypiserver</a>?</p></li>
  <li><p>Moreover, is it possible to fallback to the official PyPI server if the local pip install  commands fails (e.g. local  is not present)?</p></li>
  </ol>
  
  <p>Thanks</p>
  
  <p>Charlie</p>