Quantcast
Viewing all articles
Browse latest Browse all 35

Answer by Big_Al_Tx for How do I get a list of locally installed Python modules?

As of pip 10, the accepted answer will no longer work. The development team has removed access to the get_installed_distributions routine. There is an alternate function in the setuptools for doing the same thing. Here is an alternate version that works with pip 10:

import pkg_resourcesinstalled_packages = pkg_resources.working_setinstalled_packages_list = sorted(["%s==%s" % (i.key, i.version)     for i in installed_packages])print(installed_packages_list)

Please let me know if it will or won't work in previous versions of pip, too.


Viewing all articles
Browse latest Browse all 35

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>