Skip to content

Pip does not abort when asked to install non-existent extra #6064

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

Closed
ghost opened this issue Dec 3, 2018 · 10 comments
Closed

Pip does not abort when asked to install non-existent extra #6064

ghost opened this issue Dec 3, 2018 · 10 comments
Labels
auto-locked Outdated issues that have been locked by automation C: extras Handling optional dependencies type: enhancement Improvements to functionality

Comments

@ghost
Copy link

ghost commented Dec 3, 2018

Environment

  • pip version: doesn't matter
  • Python version: doesn't matter
  • OS: doesn't matter

Description

Suppose, you wanted to install azure[common]. Well, there isn't such a package. However, if you do this, azure package (seems like) will be installed.

Expected behavior

Error is shown to the user trying to install a nonexistent package.

How to Reproduce

Run pip install 'azure[common]'.

Output

A long wall of text indicating that things are being installed.

@RonnyPfannschmidt
Copy link
Contributor

you requested the package azure with the extra common did you perhaps intend to install the package azure-common

@ghost
Copy link
Author

ghost commented Dec 3, 2018

What I wanted is a whole different story, not worth repeating here. The ticket is about something else though: extra package common doesn't exist for azure. When you ask setuptools to install this, it will tell you that there's no such thing, and it will install nothing. pip warns you that there is no such thing, but proceeds installing something I didn't ask for: azure (presumably). I'm never even told what's going to be installed.

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Dec 14, 2018
@xavfernandez
Copy link
Member

We could maybe add an option to abort installation on a missing extra but I'm not really convinced...

@xavfernandez xavfernandez added type: enhancement Improvements to functionality C: dependency resolution About choosing which dependencies to install and removed S: needs triage Issues/PRs that need to be triaged labels Dec 18, 2018
@ghost
Copy link
Author

ghost commented Dec 18, 2018

But this is not the only instance when pip installs unwanted garbage... I just gave it as an example.

Another example is when you have a previously installed dependency with a version incompatible with the currently installed dependency. pip will not abort in such case (as would virtually any other package manager in existence), but will print a message saying that versions are incompatible and will happily continue to install junk, all of which will later appear to be broken with very little hope of discovering the culprit, unless, somehow, you managed to stash the logs somewhere, and are ready to search through them for things that look suspicious.

To give you an example of this: try depending on azure-cli while also requiring prompt_toolkit >= 2.0.0. Lots of fun there...

What I'm looking for is not a solution to this single instance. I want pip to have a mode for not screwing up the environment, and to only allow screwing up the environment with special flags, like when you install a package, but ignore its dependencies etc.

@xavfernandez
Copy link
Member

Let's keep the issue focused.

Another example is when you have a previously installed dependency with a version incompatible with the currently installed dependency.

The dependency resolution issue is #988.

with very little hope of discovering the culprit

pip check should easily give you the incompatible requirements.

@ghost
Copy link
Author

ghost commented Dec 20, 2018

pip check

That's trivial even without pip check... What's non-trivial about it is figuring out how it got there, not what the problem is.

@xavfernandez
Copy link
Member

What's non-trivial about it is figuring out how it got there, not what the problem is.

That's trivial: someone installed something conflicting without looking at the logs ;) (or did not care).

@pradyunsg pradyunsg added C: extras Handling optional dependencies and removed C: dependency resolution About choosing which dependencies to install labels Dec 20, 2018
@pradyunsg
Copy link
Member

@wvxvw Your expected behavior is:

Error is shown to the user trying to install a nonexistent package.

However, the package does exist. It doesn't have the "common" extra here. Outside of an abort, what do you think would be a good way to work with this issue?

@pradyunsg
Copy link
Member

@xavfernandez I changed the labels on this issue since it's really more about extras and not dependency resolution. Lemme know if you disagree. :)

@chrahunt chrahunt changed the title Random stuff gets installed if a package cannot be found Pip does not abort when asked to install non-existent extra Nov 24, 2019
@chrahunt
Copy link
Member

There's a new topic #7122 that has some discussion on this same issue. I'll close this in favor of that one since it has more specific discussion related to the original issue.

@wvxvw if your concerns were not met with the previously-provided links please do not hesitate to create an issue!

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: extras Handling optional dependencies type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

4 participants