pip ConnectTimeoutError

11,699

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.

Share:
11,699

Related videos on Youtube

dukabrat
Author by

dukabrat

Updated on June 04, 2022

Comments

  • dukabrat
    dukabrat 12 months

    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
      m00am about 5 years
      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.
    • dukabrat
      dukabrat about 5 years
      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
      dukabrat about 5 years
      @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..?
    • hassanzadeh.sd
      hassanzadeh.sd about 3 years
      use :pip install --default-timeout=900 something
  • dukabrat
    dukabrat about 5 years
    Yeah, that was the case, the first one!