Ubuntu – How to determine which python modules were installed with `pip` and which with `apt`

aptpackage-managementpythonsoftware installationupdates

I was trying to fix my problem with ReText (installed system-wide with pip3).
Two of my 16.04 LTS systems have different output of pip3 list.

I know that pip3 list shows all packages (installed with both pip3 and apt/apt-get).

Also I know that

  • APT installs stuff to /usr/lib/python3/dist-packages;
  • pip3 installs system-wide stuff to /usr/local/lib/python3.5/dist-packages.

How to determine which python modules were installed with pip and which with apt?

Best Answer

Not cast in stone but from this Ask Ubuntu Q&A:

As @Radu Rădeanu pointed out in this answer, there would generally be difference in names of packages as well. Canonical usually names Python 2 packages as python- and Python 3 packages as python3-. Whereas for pip we generally just need to use for both Python 2 as well as Python3 packages.

Generally speaking then:

  • If the package name starts with python- or python3- it was installed by apt.
  • Otherwise the package was installed by pip
Related Question