Is there a way to find all Python PyPI packages that were installed with easy_install or pip? I mean, excluding everything that was/is installed with the distributions tool
pip.get_installed_distributions() will give a list of installed packages
import pip
from os.path import join
for package in pip.get_installed_distributions():
print(package.location) # you can exclude packages that's in /usr/XXX
print(join(package.location, package._get_metadata("top_level.txt"))) # root directory of this package