Quantcast
Viewing all articles
Browse latest Browse all 35

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

Installation

pip install pkgutil

Code

import pkgutilfor i in pkgutil.iter_modules(None): # returns a tuple (path, package_name, ispkg_flag)    print(i[1]) #or you can append it to a list

Sample Output:

multiprocessingnetrcnntplibntpathnturl2pathnumbersopcodepicklepickletoolspipespkgutil

Viewing all articles
Browse latest Browse all 35

Trending Articles



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