Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip-compile gives misleading error message if no internet #352

Closed
cjerdonek opened this issue May 2, 2016 · 3 comments
Closed

pip-compile gives misleading error message if no internet #352

cjerdonek opened this issue May 2, 2016 · 3 comments
Labels
PR wanted Feature is discussed or bug is confirmed, PR needed

Comments

@cjerdonek
Copy link

If there is no internet access, pip-compile will fail with a misleading message. This is with pip-compile 1.6.1, pip 8.1.1, and Python 3.5.1.

Steps to replicate
  1. Create a requirements.in file with a single project name.
  2. Disable internet access (e.g. by disabling wi-fi).
  3. Run pip-compile --verbose requirements.in.
Expected result

The command should fail with an error message relating to the fact that there is no internet connection.

Actual result

Instead, the output looks something like this:

Using indexes:
  https://pypi.python.org/simple

                          ROUND 1                           
Current constraints:
  MyPackage

Finding the best candidates:
Could not find a version that matches MyPackage
Tried: (no version found at all)
@nvie
Copy link
Member

nvie commented May 2, 2016

Wow, that's pretty bad. Thanks for reporting, this obviously needs to be fixed.

@nvie nvie added the PR wanted Feature is discussed or bug is confirmed, PR needed label May 2, 2016
@cjerdonek
Copy link
Author

Note that it's possible this is due in part to a similar bug / behavior in pip itself. If I run the following with no internet:

$ pip install --retries 0 MyPackage > temp.txt

then pip's stderr output looks like this--

  Could not find a version that satisfies the requirement MyPackage (from versions: )
No matching distribution found for MyPackage

Without the retries argument, you will at least see connection errors prior to this. As with this report, it would be better if pip's final error message says something about the inability to connect.

@cjerdonek
Copy link
Author

FYI, I filed the analogous issue for pip here: pypa/pip#3642

It's possible that if pip fixes that issue the right way, then this bug will also go away (at least for the versions of pip where that issue is fixed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR wanted Feature is discussed or bug is confirmed, PR needed
Projects
None yet
Development

No branches or pull requests

2 participants