10

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?

2 Answers 2

10

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

Sign up to request clarification or add additional context in comments.

Comments

1

This is what worked for me:

  1. unset all_proxy (optional in case none are set)
  2. pip install 'requests[socks]' inside the venv

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.