Skip to content

pip uninstall fails when called in the package's source dir #6703

@reynoldsnlp

Description

@reynoldsnlp

Environment

  • pip version: 19.1.1
  • Python version: 3.6.8
  • OS: macOS

Description

I installed a local package, spam, using python3 -m pip install --user .. If I try to uninstall my package when the package folder is in the current directory, I get the following:

$ pwd
/Users/me/spam
$ ls
README.md  setup.cfg  setup.py  test  tox.ini  spam
$ python3 -m pip uninstall --verbose spam
Not sure how to uninstall: spam 0.0.1 - Check: /Users/me/spam  # this line only shown with --verbose flag
Can't uninstall 'spam'. No files were found to uninstall.

The uninstall completes successfully when I run it from a different directory:

$ cd \tmp && python3 -m pip uninstall --verbose spam
# successfully uninstalls...

Expected behavior
I did not expect uninstall to be sensitive to the contents of the local directory. If this is the expected behavior for technical reasons, I would change the stderr message Can't uninstall 'spam'. No files were found to uninstall. to be more helpful in indicating that the failure could be because there is a local folder with the target package's name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: error messagesImproving error messagesUXUser experience relatedtype: enhancementImprovements to functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions