I want to remove a Python package, let’s say Satchmo. But I don’t remember which tool I used to install it.
I can think of the following ways:
- Downloading source
- distutils
- distribute
- SetupTools
- Python package managers
- EasyInstall
- PyPM
- pip
- apt-get
Is there a way to determine how it was installed? I think I need this information to safely and properly remove them.
Each installation tool may keep a separate index of which packages it knows about/has installed. All Python cares about is that the files are in place. So basically, if you think it may have been installed with a certain tool, you’ll have to ask the tool.
For apt/dpkg, you can check if the package appears in the
dpkg -llisting. I do not know whether pip’s index is as easily accessible, but you could simply try runningpip uninstall package-name, it should complain if it didn’t install the package. I don’t know about PyPM, but if you installed from source or with easy_install, you’ll simply have to track down and remove the files, the package isn’t listed anywhere.