question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot remove entries from nonexistent file

See original GitHub issue
  • pip version: 20.0.2
  • Python version: 3.7.6
  • Operating system: OSX

Problem

It appears that when attempting to uninstall a package that was installed in editable mode, removing it does not work correctly if the lib/python3.7/site-packages/easy-install.pth file does not exist.

Reproduction

  1. In a new folder, create a setup.py file:
from setuptools import setup

setup(
    name='repro',
    version='0.1dev',
)
  1. Create a virtualenv: python3 -m venv env
  2. Install in editable mode: env/bin/pip install -e .
  3. Manually remove the file: rm env/lib/python3.7/site-packages/easy-install.pth
  4. Attempt to uninstall the editable package: env/bin/pip uninstall repro
  5. Observe error message: ERROR: Cannot remove entries from nonexistent file /..../env/lib/python3.7/site-packages/easy-install.pth

Expected Behavior

The uninstall should complete successfully, removing the .egg-link, even if the easy-install.pth file is not found.

Notes

In the wild, there is something that happens with our internal setup that causes the egg-link, to be created, but not the easy-install.pth file. I’m still trying to track down how this happens. Regardless of this, I believe that pip should not fail to uninstall when the file easy-install.pth doesn’t exist, as the operation it would have done there would have just removed the entry from the file anyway.

I am happy to provide any further detail if needed. Thanks! 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
deveshkscommented, Mar 24, 2020

Thanks @uranusjr for the response. I will create a PR to do the same.

1reaction
uranusjrcommented, Mar 13, 2020

Sounds reasonable to me. The error message can continue to exist, but the uninstallation command does not need to fail. (It would help if pip has a mechanism to fail with a specific error code, but if the choice is between 1 and 0, I would prefer 0.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot remove entries from nonexistent file - Stack Overflow
I'm assuming you're having an issue with pip install or something that uses it like tox ? This is a known issue with...
Read more >
Solution: Cannot remove entries from nonexistent file easy ...
I just created the file as an empty file, i.e.: touch c:\python36\lib\site-packages\easy-install. pth and the error went away. Not sure how I ...
Read more >
Cannot remove entries from nonexistent file l:\downloads\carla_0 ...
Getting this error while trying to uninstall Carla 0.9.5 as I need Carla 0.9.8 version now. Please tell me how should I uninstall...
Read more >
Threat found that can't be removed from a non existent file
Hello, Windows Defender keeps giving me this warning. Please note that the file mentioned in the path doesn't exist anymore and whenever I ......
Read more >
专栏收录该内容 - CSDN博客
遇到问题:Cannot remove entries from nonexistent file /usr/local/bin/anaconda2/lib/python2.7/site-packages/easy-install.pth删除后setuptools ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found