Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deciding which package manager was used to install a Python package

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.

like image 558
Mads Skjern Avatar asked Dec 11 '25 22:12

Mads Skjern


1 Answers

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 -l listing. I do not know whether pip's index is as easily accessible, but you could simply try running pip 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.

like image 200
tjollans Avatar answered Dec 14 '25 13:12

tjollans