2

When trying to install something using pip I am getting a ConnectTimeoutError error ! For example, when I try:

pip install 'something'

The following error occurs:

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(, 'Connection to 'some dev server' timed out. (connect timeout=15)')': /.../.../

Is my pip behind some proxy?

m00am
  • 5,910
  • 11
  • 53
  • 69
dukabrat
  • 35
  • 1
  • 1
  • 4
  • 1
    Welcome to SO. I reformatted the question to be more readable. In your error log I see pip is trying to reach `'some dev server'`. Are you using a custom/ local server instead of PyPI? If that is the case, please add this information to the question. – m00am Mar 09 '18 at 08:42
  • Hi! Probably that is the case. I'm not sure how can I check it, and set pip not to use private server..?? Thanks for answer. – dukabrat Mar 09 '18 at 16:59
  • @m00am could you please help me with these..? How can I check am I using a custom/ local server instead of PyPI? And how can I fix it..? – dukabrat Mar 10 '18 at 20:09
  • use :`pip install --default-timeout=900 something` – hassanzadeh.sd Apr 13 '20 at 14:36

1 Answers1

1

To clarify, by default pip installs software from https://pypi.python.org/pypi. However, pip can be configured to use a different server.

It seems like you are not able to reach the PyPI server that your pip is trying to use. In your error message you have the string 'Connection to 'some dev server' timed out.. If I see that correctly, your pip is trying to connect to a local PyPI server instead of the public one.

This post and this one describe how to set up a custom PyPI server. Both describe different ways to tell pip which server to use.

.pip/pip.conf

In this config file you can specify an index-url which points to a custom server. Check if this file exists and has a value for index-url that does not point to https://pypi.python.org/pypi. The example given in the first post looks like this:

[global]
index-url = https://pip.curle.io/simple/

This tells pip to not use the public PyPI server, but the one at https://pip.curle.io/simple/.

.pypirc

This file that should sit in your home folder can also contain alternative paths to PyPI servers. They can look like this (taken from second link):

[distutils]
index-servers =
    internal

[internal]
repository: https://pypi.myserver.com/
username: username
password: password

This one points to the local server https://pypi.myserver.com/ under the name internal. Check if this file is present and its content.

What to do?

If you find the local PyPI server, find out who runs it and if it is currently running. This error can arise if the server process stopped or the machine it usually runs on is down. Any advice more specific than that would require more information from your side on your work environment.

m00am
  • 5,910
  • 11
  • 53
  • 69