question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installing without an internet connection erroneous reports requirements are up to date

See original GitHub issue
  • Pip version: 9.0.1
  • Python version: 3.5
  • Operating system: Fedora 25

Description:

Installing without an internet connection gives erroneous output.

Specifically after attempting to fetch some information from the net, it will report that a requirement is up to date. I had pytest-2.9.2 installed, and without internet it shows

Requirement already up-to-date: pytest in /usr/lib/python3.5/site-packages

With internet, it upgrades to pytest-3.0.6.

What I’ve run:

$ python3 -m pip install -U pytest
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f77960b9cc0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pytest/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f779605a128>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pytest/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f779508e4e0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pytest/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f779507d6d8>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pytest/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f779507d828>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/pytest/
Requirement already up-to-date: pytest in /usr/lib/python3.5/site-packages
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7795031f98>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/py/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7795031e48>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/py/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7795038080>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/py/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7795038128>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/py/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f7795038208>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/py/
Requirement already up-to-date: py>=1.4.29 in /usr/lib/python3.5/site-packages (from pytest)

Then with an internet connection,

$ sudo python3 -m pip install -U pytest
[sudo] password for jayvdb: 
Collecting pytest
  Downloading pytest-3.0.6-py2.py3-none-any.whl (172kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 174kB 612kB/s 
Collecting setuptools (from pytest)
  Downloading setuptools-34.1.1-py2.py3-none-any.whl (389kB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 399kB 624kB/s 
Requirement already up-to-date: py>=1.4.29 in /usr/lib/python3.5/site-packages (from pytest)
Requirement already up-to-date: six>=1.6.0 in /usr/lib/python3.5/site-packages (from setuptools->pytest)
Requirement already up-to-date: packaging>=16.8 in /usr/lib/python3.5/site-packages (from setuptools->pytest)
Requirement already up-to-date: appdirs>=1.4.0 in /usr/lib/python3.5/site-packages (from setuptools->pytest)
Requirement already up-to-date: pyparsing in /usr/lib/python3.5/site-packages (from packaging>=16.8->setuptools->pytest)
Installing collected packages: setuptools, pytest
  Found existing installation: setuptools 27.1.2
    Uninstalling setuptools-27.1.2:
      Successfully uninstalled setuptools-27.1.2
  Found existing installation: pytest 2.9.2
    Uninstalling pytest-2.9.2:
      Successfully uninstalled pytest-2.9.2
Successfully installed pytest-3.0.6 setuptools-34.1.1

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jayvdbcommented, Feb 9, 2017

I don’t have any custom repositories setup. Only the cache. pip should give a non-zero exit status and an appropriate failure message, even β€œNo repositories could be reached” would be better.

0reactions
chrahuntcommented, Aug 10, 2019

How would this look in the following situations:

  1. Multiple repositories are configured and only some of them are unreachable
  2. No repositories are reachable but --find-links was provided on the command-line
  3. Same as the above two, but the currently-installed requirement does not have any available versions present

I could see reasonable use cases for the above that would all want different behavior, especially with respect to return code since it would be relevant to CI or any automation.

I think the best we could do here without being on the hook to make things complex later is to add an explicit warning when we’re giving up on an index:

Giving up on index <url>, due to <last error>

That easy enough to grep, so enforcement that a repo is accessible in CI (for users that don’t want to pin versions) should be straightforward.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An error occurred while installing (any game) (no internet ...
I am directly connected to my modem so there is no wireless connection active. Any game that I have already downloaded or is...
Read more >
McAfee Installer reports "No Internet Connection" (TS101825)
McAfee Installer reports "No Internet Connection" Β· Click Start Start icon at the bottom left of your Windows desktop. Β· Type Internet Options...
Read more >
Fix problems installing Chrome - Google Chrome Help
Start menu or Start menu . Open the Windows Settings app. In the "Find a setting" search box, type Firewall. Click Allow an...
Read more >
"Establish an Internet connection to continue" when starting ...
Solution 1: Install Transport Layer Security (TLS) updates corresponding to your Autodesk software and version. Β· Solution 2: Correct inaccurate ...
Read more >
Why do I get a connection error when installing or activating ...
Just set the blocked IP to "allow permanently" to let the installer connect and download your license details, software and associated toolboxes. 1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found