AndreaF
AndreaF

Reputation: 12385

How to force pip uninstall in case of missing files

I need to remove a corrupted old version of setuptools package from pip

unfortunately pip uninstall setuptools

doesn't work because cannot find some entries and returns me:

Cannot remove entries from nonexistent file ...

errors

For the install procedure you can use --ignore-installed to continue the operation anyway for uninstalling procedure this flag seems not recognized.

What command should use to achieve the package deletion?

Upvotes: 5

Views: 28563

Answers (2)

nick
nick

Reputation: 891

You can do it manually by removing the directory and egg file. Look for site-packages directory and there should be something like setuptools.egg-info, delete (or move that) and then run the following with whatever version/location you are using:

sudo rm -rf /usr/local/lib/python2.7/dist-packages/setuptools

Upvotes: 10

Ajay Singh
Ajay Singh

Reputation: 1281

Possible work-around: pip install --upgrade --I setuptools

Upvotes: 0

Related Questions