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

Can't uninstall package installed with sudo pip install -e - "No files were found to uninstall." #5330

Closed
Poupine opened this issue Apr 25, 2018 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation C: editable Editable installations C: uninstall The logic for uninstallation of packages state: needs reproducer Need to reproduce issue type: support User Support

Comments

@Poupine
Copy link

Poupine commented Apr 25, 2018

  • Pip version: 10.0.1
  • Python version: 3.5
  • Operating system: Ubuntu Xenial

When installing a local package with sudo -H pip3 install -e <path-to-my-package>, my package is found and imported as expected, but the way it is done is possibly the worst that could possibly have been implemented ...

Let me explain: what it does, is somehow adding <path-to-my-package> in my python path in some obscure way and when I run sudo -H pip3 uninstall <my-package-name>, I am greeted with the following message: Can't uninstall '<my-package-name>'. No files were found to uninstall.

Where it becomes annoying is that even after deleting the egg-link file corresponding to my package from dist-packages, my python path still has the path to my library which means if my library is broken (which happened twice already in the span of 2 days with 2 different libraries), I am stuck with an unusable version of my library.

The only solution I have found so far to this, since I have no idea how the path to my library gets written to the python path, has been to wipe clean python and pip from my system and reinstall from scratch.

PS: Installing without -e has the correct behaviour (as in when I uninstall my package it actually does uninstall it).

@FragLegs
Copy link

FragLegs commented May 2, 2018

I have found similar problems uninstalling an editable install with any version of pip >= 10.0.0

Steps to reproduce are below. I'm using mkproject from virtualenvwrapper for efficiency and editable installing requests but it happens with any package.

mkproject pip-issue
pip install pip==10.0.0
git clone git@github.com:requests/requests.git .
pip install -e .
pip uninstall requests

I get the following error:

Not uninstalling requests at /home/smiel/projects/pip-issue, outside environment /home/smiel/.venvs/pip-issue
Can't uninstall 'requests'. No files were found to uninstall.

Python version: 2.7.12
OS: Ubuntu 16.04.4 LTS

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label May 6, 2018
@hpk42
Copy link

hpk42 commented May 21, 2018

i also get "uninstall" problems for packages which i installed with "pip install -e .". it's consistent and happens with newest virtualenv (16.0) and pip (10.0.1) on my ubu16.04.

Downgrading to pip-0.9.3 fixes the issue, i can uninstall again.

@cjerdonek cjerdonek added the C: editable Editable installations label Aug 18, 2018
@chrahunt chrahunt changed the title pip install -e -- broken behaviour Can't uninstall package installed with sudo pip install -e - "No files were found to uninstall." Oct 28, 2019
@chrahunt chrahunt added C: uninstall The logic for uninstallation of packages S: awaiting response Waiting for a response/more information state: needs reproducer Need to reproduce issue type: support User Support labels Oct 28, 2019
@triage-new-issues triage-new-issues bot removed S: needs triage Issues/PRs that need to be triaged labels Oct 28, 2019
@chrahunt
Copy link
Member

@FragLegs that looks different to me - if this is still affecting you please feel free to create a new issue so we can take a look.

Hi @Poupine - the .egg-link file is how setuptools keeps track of the mapping between the editable project name and the actual source directory, but the project gets onto sys.path via easy-install.pth. If you remove the directory from easy-install.pth in the corresponding site-packages directory then your library should no longer be available in the environment.

For the underlying issue, this looks like it could be the same as #5193. Can you provide clear instructions to reproduce this so we can confirm it?

@no-response
Copy link

no-response bot commented Nov 12, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Nov 12, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 12, 2019
@pradyunsg pradyunsg removed the S: awaiting response Waiting for a response/more information label Mar 17, 2023
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: editable Editable installations C: uninstall The logic for uninstallation of packages state: needs reproducer Need to reproduce issue type: support User Support
Projects
None yet
Development

No branches or pull requests

6 participants