How to get a list of locally installed Python modules?


I want to check all the locally installed Python modules in my system, how can I do it?

1 Answer

4 years ago by

You can use the below code,

import pip
sorted(["%s==%s" % (i.key, i.version) for i in pip.get_installed_distributions()])
4 years ago by Divya