pip install and custom index url

19,262

Solution 1

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

You might see the following error in case the connection to pypi.python.org is not open to access (e.g. because of your firewall rules).

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(111, 'Connection refused'))': /simple/<package>/

The -v option (enabling debug logging/verbose mode is a nice way to start debugging).

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.

We 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

If you have set the conf and yet if the pip conf is not being picked check that pip.conf is in the right home directory for the user.

e.g. /root, / or /home/user

Solution 2

This is what worked for me:

  1. unset all_proxy (optional in case none are set)
  2. pip install 'requests[socks]' inside the venv
Share:
19,262
Amod Pandey
Author by

Amod Pandey

Updated on June 21, 2022

Comments

  • Amod Pandey
    Amod Pandey almost 2 years

    I am getting the following exception while trying to install using pip:

    Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(111, 'Connection refused'))': /simple/<package>/

    Where does pip install the packages from?

    How do I proxy or use alternate internal site to get these packages?