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

Name canonicalization issue in pip uninstall #8609

Closed
sbidoul opened this issue Jul 21, 2020 · 5 comments
Closed

Name canonicalization issue in pip uninstall #8609

sbidoul opened this issue Jul 21, 2020 · 5 comments
Labels
C: uninstall The logic for uninstallation of packages type: bug A confirmed bug or unintended behavior

Comments

@sbidoul
Copy link
Member

sbidoul commented Jul 21, 2020

Environment

  • pip version: 20.1
  • Python version: 3
  • OS: Linux (probably irrelevant)

Description

pip uninstall should canonicalize names when determining if they are installed.

How to Reproduce

$ pip install zope-interface  # notice the dash
$ pip list
...
zope.interface  # notice the dot
$ pip uninstall zope-interface  # same name as in pip install
WARNING: Skipping zope-interface as it is not installed.

Expected result

In the example above, pip should have uninstalled zope.interface.

This is easily worked around when used manually, but is more annoying when the uninstall command is invoked by tools working with canonical names.

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Jul 21, 2020
@sbidoul sbidoul added the C: uninstall The logic for uninstallation of packages label Jul 21, 2020
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Jul 21, 2020
@sbidoul sbidoul added the type: bug A confirmed bug or unintended behavior label Jul 21, 2020
@atugushev
Copy link
Contributor

Looks like it's fixed in #8054.

@McSinyx
Copy link
Contributor

McSinyx commented Jul 26, 2020

@atugushev, I can still reproduce this using master pip—GH-8054 only seems to fix it for pip install and pip list {-u,-o} but pip list and pip uninstall.

@atugushev
Copy link
Contributor

@McSinyx

Checked on aff33ff:

$ pip --version
pip 20.2.dev1 from /Users/albert/Projects/pip/src/pip (python 3.8)

$ pip install zope-interface
Collecting zope-interface
  Using cached zope.interface-5.1.0-cp38-cp38-macosx_10_9_x86_64.whl (192 kB)
Requirement already satisfied: setuptools in ./.venv/lib/python3.8/site-packages (from zope-interface) (45.2.0)
Installing collected packages: zope-interface
Successfully installed zope-interface

$ pip list | grep zope
zope.interface       5.1.0

$ pip uninstall zope-interface
Found existing installation: zope.interface 5.1.0
Uninstalling zope.interface-5.1.0:
  Would remove:
    /Users/albert/Projects/pip/.venv/lib/python3.8/site-packages/zope.interface-5.1.0-py3.8-nspkg.pth
    /Users/albert/Projects/pip/.venv/lib/python3.8/site-packages/zope.interface-5.1.0.dist-info/*
    /Users/albert/Projects/pip/.venv/lib/python3.8/site-packages/zope/interface/*
Proceed (y/n)?

@McSinyx
Copy link
Contributor

McSinyx commented Jul 26, 2020

Please have my apologies: you are correct, I was testing on an venv and it uses pip's latest release instead of the editable version. I can confirm that the problem is solved as of current master.

@sbidoul
Copy link
Member Author

sbidoul commented Jul 26, 2020

Ah, perfect. Thanks for investigating this @atugushev.

@sbidoul sbidoul closed this as completed Jul 26, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: uninstall The logic for uninstallation of packages type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants