I have installed a python package with python setup.py install
.
How do I uninstall it?
I have installed a python package with python setup.py install
.
How do I uninstall it?
You need to remove all files manually, and also undo any other stuff that installation did manually.
If you don't know the list of all files, you can reinstall it with the --record
option, and take a look at the list this produces.
Go to your python package directory and remove your .egg file, e.g.: In python 2.5(ubuntu): /usr/lib/python2.5/site-packages/
In python 2.6(ubuntu): /usr/local/lib/python2.6/dist-packages/
The lazy way: simply uninstall from the Windows installation menu (if you're using Windows), or from the rpm command, provided you first re-install it after creating a distribution package.
For example,
python setup.py bdist_wininst
dist/foo-1.0.win32.exe
("foo" being an example of course).
Extending on what Martin said, recording the install output and a little bash scripting does the trick quite nicely. Here's what I do...
for i in $(less install.record); sudo rm $i; done;
And presto. Uninstalled.
Last answer helped me out so thanks for that. Not sure why I didn't think of it. Just a syntax correction though:
for i in $(less install.record); sudo rm $i; done;
should be:
for i in $(less install.record); do sudo rm $i; done;
otherwise you'll get a syntax error from bash. Also, be sure to change 'install.record' to whatever file you passed to your --record option. Not trying to be critical, just wanted to clarify in case someone who didn't know much about bash came across this post.
Or more simply you could just do;
sudo rm $(cat install.record)
This works because the rm command takes a whitespace-seperated list of files to delete and your installation record is just such a list. Also, using "less" for this type of command could get you in big trouble depending on the local configuration.