pip: PIP throwing network is unreachable

  • Pip version: 10.0.1
  • Python version: 3.6.4
  • Operating system: CentOS 7

Description:

Unable to install python package after upgrading pip.

What I’ve run:

I was getting the error for the following command.

[alawrence@localhost backend-project]$ pip install pipenv --user
Collecting pipenv
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4003f84a20>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /packages/2c/01/37a5867a47d52856b077d0faa561b791cb6e6e3e9410837b6d62f569c1e6/pipenv-11.10.1-py3-none-any.whl
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4003f84cc0>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /packages/2c/01/37a5867a47d52856b077d0faa561b791cb6e6e3e9410837b6d62f569c1e6/pipenv-11.10.1-py3-none-any.whl
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/2c/01/37a5867a47d52856b077d0faa561b791cb6e6e3e9410837b6d62f569c1e6/pipenv-11.10.1-py3-none-any.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4003f3b3c8>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

I verified the connectivity using requests. Everything is fine with the network.

Please help

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 17 (6 by maintainers)

Most upvoted comments

This is not a PIP issue. Most probable cause is the kind of network you’re on. Generally happens when you’re behind proxies.

@BigChief45 This should be resolved now.

This is the solution for use PIP under proxy in Linux (Debian/RPM). tested on Centos 7

Use proxy option at command line or pass environment variable for automatic use.

# yum install -y python-pip
# pip install docker-compose --proxy="192.168.0.251:808"

OR

# export https_proxy=http://192.168.0.251:808
# export http_proxy=http://192.168.0.251:808
# pip search docker

@akhilputhiry @BigChief45 @avimehenwal @benoit-pierre @pradyunsg

@avimehenwal: I’m not getting any error here (on Manjaro Linux). For the difference between packages you can install and those you cannot, maybe you’re hitting the cache?