Can you simply delete the directory from your python installation, or are there any lingering files that you must delete?
Another time stamp based hack:
touch /tmp/ts
python setup.py install --prefix=<PREFIX>
find <PREFIX> -cnewer /tmp/ts | xargs rm -r
For Windows 7,
Control Panel --> Programs --> Uninstall
, then
choose the python package to remove.
The three things that get installed that you will need to delete are:
Now on my linux system these live in:
But on a windows system they are more likely to be entirely within the Python distribution directory. I have no idea about OSX except it is more likey to follow the linux pattern.
ERROR: flake8 3.7.9 has requirement pycodestyle<2.6.0,>=2.5.0, but you'll have pycodestyle 2.3.1 which is incompatible.
ERROR: nuscenes-devkit 1.0.8 has requirement motmetrics<=1.1.3, but you'll have motmetrics 1.2.0 which is incompatible.
Installing collected packages: descartes, future, torch, cachetools, torchvision, flake8-import-order, xmltodict, entrypoints, flake8, motmetrics, nuscenes-devkit
Attempting uninstall: torch
Found existing installation: torch 1.0.0
Uninstalling torch-1.0.0:
Successfully uninstalled torch-1.0.0
Attempting uninstall: torchvision
Found existing installation: torchvision 0.2.1
Uninstalling torchvision-0.2.1:
Successfully uninstalled torchvision-0.2.1
Attempting uninstall: entrypoints
Found existing installation: entrypoints 0.2.3
ERROR: Cannot uninstall 'entrypoints'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Then I type:
conda uninstall entrypoints
pip install --upgrade pycodestyle
pip install nuscenes-devkit
Done!
Yes, it is safe to simply delete anything that distutils installed. That goes for installed folders or .egg files. Naturally anything that depends on that code will no longer work.
If you want to make it work again, simply re-install.
By the way, if you are using distutils also consider using the multi-version feature. It allows you to have multiple versions of any single package installed. That means you do not need to delete an old version of a package if you simply want to install a newer version.
I just uninstalled a python package, and even though I'm not certain I did so perfectly, I'm reasonably confident.
I started by getting a list of all python-related files, ordered by date, on the assumption that all of the files in my package will have more or less the same timestamp, and no other files will.
Luckily, I've got python installed under /opt/Python-2.6.1
; if I had been using the Python that comes with my Linux distro, I'd have had to scour all of /usr
, which would have taken a long time.
Then I just examined that list, and noted with relief that all the stuff that I wanted to nuke consisted of one directory, /opt/Python-2.6.1/lib/python2.6/site-packages/module-name/
, and one file, /opt/Python-2.6.1/lib/python2.6/site-packages/module-x.x.x_blah-py2.6.egg-info
.
So I just deleted those.
Here's how I got the date-sorted list of files:
find "$@" -printf '%T@ ' -ls | sort -n | cut -d\ -f 2-
(I think that's got to be GNU "find", by the way; the flavor you get on OS X doesn't know about "-printf '%T@'")
I use that all the time.