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

ImportError when running with pip==9.0.2 #5

Closed
jantman opened this issue Mar 18, 2018 · 1 comment
Closed

ImportError when running with pip==9.0.2 #5

jantman opened this issue Mar 18, 2018 · 1 comment

Comments

@jantman
Copy link
Owner

@jantman jantman commented Mar 18, 2018

This is failing on import pip with pip==9.0.2. This appears to be caused by pypa/pip#5079

The gist is:

  1. pip has no supported external API, so import pip isn't officially supported at all. We consider using pip itself to be best-effort, and currently have it within a try/except ImportError but that doesn't handle the KeyError that is now being raised.
  2. We're making calls to pip.get_installed_distributions() and pip.FrozenRequirement. It just sucks that these aren't supported APIs, and that (especially for the purpose of applications like ours) there's no supported way to programmatically get information out of pip.
@jantman

This comment has been minimized.

Copy link
Owner Author

@jantman jantman commented Mar 18, 2018

Using pip 9.0.2 this seems to be the same as pypa/pip#5079

Specifically, the KeyError is raised if requests is imported before pip.

@jantman jantman closed this in 5238161 Mar 18, 2018
jantman added a commit to jantman/biweeklybudget that referenced this issue Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.