0

I am currently in the following situation: my company has a proxy server for all external sites, but all internal hosts are direct connect only. Accessing them through the proxy will result in a proxy error. We have an internal pypi (added as extra index) where we host our own python packages, and of course we rely on the official pypi as well for officially released packages.

pip, the python package installer, honours the HTTP_PROXY variable, but the problem is that it is an all or nothing situation, meaning that either I can't connect to the internal pypi or the external one.

A browser normally handles this via proxy.pac, but a command line tool does not do this.

I don't have access to the proxy configuration and it's unlikely I can change it. I am asking on this SE because it's more likely to have tricks I am not familiar with to deal with this situation.

Stefano Borini
  • 251
  • 1
  • 5
  • 11

1 Answers1

0

pip install looks at http://pypi.python.org/simple//

Often companies create a proxy to http://pypi.python.org/simple so all the internal sites can access it when they are not exposed to internet.

If you cannot modify your proxy setup, it might be easier for you to stand up a clone/mirror of the official repo site, so you can pull any package via your local mirror.

You can configure this url in pip.conf. By default pip looks into $HOME/.pip/pip.conf for configuration data.

[global]
extra-index-url = https://my-pypi.mywebsite.com/simple
timeout = 10
Ron
  • 171
  • 7
  • What if my company were not to provide an internal mirror, so that I have to rely on both internal and external access during a single invocation of pip? – Stefano Borini May 14 '20 at 12:50