Python: uninstall a ghost package

Viewed 62

I've got a project damastes, which introduced two packages, damastes and procrustes:

>>> import damastes
>>> import procrustes

I removed the procrustes package from the project, without changing the damastes project version, rebuilt and reinstalled the project:

$ poetry build
$ pip install dist/damastes... --user -I

but

>>> import procrustes

is still very much alive. It won't show on $ pip list, and why should it? It's part of the damastes package.

Here is the ghost:

$ locate procrustes
/home/user/.local/lib/python3.9/site-packages/procrustes
/home/user/.local/lib/python3.9/site-packages/procrustes/__init__.py
/home/user/.local/lib/python3.9/site-packages/procrustes/__pycache__
/home/user/.local/lib/python3.9/site-packages/procrustes/procrustes.py
/home/user/.local/lib/python3.9/site-packages/procrustes/run.py

Is there a legitimate way to pinpoint and clean it up? Or do I have to remove the procrustes directory manually?

1 Answers

The procrustes.egg-info folder is not available in the site-packages folder. That's why pip can't detect it. Remove it manually. Or install it via pip install and then pip uninstall works.

Related