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

--prefix does not work with pip unistall #11213

Open
1 task done
JakobDev opened this issue Jun 28, 2022 · 1 comment
Open
1 task done

--prefix does not work with pip unistall #11213

JakobDev opened this issue Jun 28, 2022 · 1 comment
Labels
S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior

Comments

@JakobDev
Copy link

Description

Running this command

pip install --ignore-installed --no-deps --prefix /tmp/testpip requests

installs requests into /tmp/testpip.

But running this command:

pip uninstall --prefix /tmp/testpip requests

results in this error:

Usage:   
  pip uninstall [options] <package> ...
  pip uninstall [options] -r <requirements file> ...

no such option: --prefix

Expected behavior

pip should uninstall requests from the given prefix. If install allows this argument, uninstall should allow it too.

pip version

22.1.2

Python version

3.10

OS

Manjaro

How to Reproduce

See above

Output

No response

Code of Conduct

@JakobDev JakobDev added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jun 28, 2022
@pfmoore
Copy link
Member

pfmoore commented Jul 25, 2022

The problem here is that --prefix is simply one of a number of variants (the others being --root and --target) that try to influence "where pip installs things", but none of them actually fulfil the role of "specify the environment that pip is working on" - which is likely what the user actually wants.

Personally, I would prefer to see a global option, that tells pip what environment it should work on. That would affect all ways in which pip finds and manages installed packages, and could ultimately replace all of --target, --root, and --prefix.

So while I agree that the issue raise here is correct, I don't think we should address it by adding a --prefix flag to uninstall (to do so would be a lot harder than it seems at first, because pip uninstall X finds X in the "default environment", which doesn't recognise --prefix, and can't easily be made to). As a workaround for now, uninstalling can be handled by simply deleting the relevant files at the OS level.

See also #4575

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants