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 --ignore-installed unexpected behavior #1097

Closed
tarekziade opened this Issue Jul 28, 2013 · 7 comments

Comments

Projects
None yet
3 participants
@tarekziade

tarekziade commented Jul 28, 2013

@carljm said this is the expected behavior:

If I have a project that's installed, and if I try to install it in another directory, using -I to ignore the installed version, pip should not uninstall the original one.

But it turns out it does uninstall the original one, see (I had mock installed):

http://tarek.pastebin.mozilla.org/2731680

Also happens with 1.4

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Jul 29, 2013

Contributor

from what I can tell, the parameter means to ignore the fact that an existing installation satisfies your requirement, and uninstall it regardless. I can update the help string for it to be clearer.

Contributor

qwcode commented Jul 29, 2013

from what I can tell, the parameter means to ignore the fact that an existing installation satisfies your requirement, and uninstall it regardless. I can update the help string for it to be clearer.

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Jul 29, 2013

Contributor

an option that truly ignored an installation could be really bad. the result could be confusing double installs of metadata, when used against the same site-packages

Contributor

qwcode commented Jul 29, 2013

an option that truly ignored an installation could be really bad. the result could be confusing double installs of metadata, when used against the same site-packages

@carljm

This comment has been minimized.

Show comment
Hide comment
@carljm

carljm Jul 31, 2013

Contributor

At one point the intended meaning of the -I parameter was in fact to fully act as if there were no existing installation; thus not to touch it at all. It seems that at some point that meaning was changed in practice; I don't know if that change was intentional or accidental, but it was a change.

I think the original meaning makes more sense with the name --ignore-installed than this new meaning; to uninstall something is clearly not ignoring it.

It's true that this is an advanced feature that can lead to confusing results if used without understanding, but it is very useful in some circumstances and the workarounds for not having it are painful (you have to create a new temporary clean virtualenv just to run a command in it). So I would be in favor of fixing it to the original meaning (and warning of the dangers in its help string.)

Contributor

carljm commented Jul 31, 2013

At one point the intended meaning of the -I parameter was in fact to fully act as if there were no existing installation; thus not to touch it at all. It seems that at some point that meaning was changed in practice; I don't know if that change was intentional or accidental, but it was a change.

I think the original meaning makes more sense with the name --ignore-installed than this new meaning; to uninstall something is clearly not ignoring it.

It's true that this is an advanced feature that can lead to confusing results if used without understanding, but it is very useful in some circumstances and the workarounds for not having it are painful (you have to create a new temporary clean virtualenv just to run a command in it). So I would be in favor of fixing it to the original meaning (and warning of the dangers in its help string.)

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Jul 31, 2013

Contributor

let me see if I can track down when the change happened, and in what context.

Contributor

qwcode commented Jul 31, 2013

let me see if I can track down when the change happened, and in what context.

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Nov 29, 2013

Contributor

looks like this is when the change in behavior occurred (in 2011), and it was not intentional.
2e1b880

An additional unguarded call to check_if_exists was added, which sets the conflicts_with property, which sets up the unwanted uninstall we're seeing.

Contributor

qwcode commented Nov 29, 2013

looks like this is when the change in behavior occurred (in 2011), and it was not intentional.
2e1b880

An additional unguarded call to check_if_exists was added, which sets the conflicts_with property, which sets up the unwanted uninstall we're seeing.

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Nov 29, 2013

Contributor

I'll fix and try to get this into the next 1.5 beta.
We have one test for this, but it looks broke

Contributor

qwcode commented Nov 29, 2013

I'll fix and try to get this into the next 1.5 beta.
We have one test for this, but it looks broke

qwcode added a commit to qwcode/pip that referenced this issue Nov 29, 2013

qwcode added a commit that referenced this issue Nov 29, 2013

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Nov 29, 2013

Contributor

closing. PR #1352 was merged into 1.5.X.

Contributor

qwcode commented Nov 29, 2013

closing. PR #1352 was merged into 1.5.X.

@qwcode qwcode closed this Nov 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment