list versions of all installed modules

Scott David Daniels Scott.Daniels at Acm.Org
Tue Oct 28 12:26:08 EDT 2008


John [H2O] wrote:
> Is there a quick way to list the version of each installed module? 

import sys
for name, module in sorted(sys.modules.items()):
     if hasattr(module, '__version__'):
         print name, module.__version__

Of course if you add __VERSION__, VERSION, and version, you
may get more.

--Scott David Daniels
Scott.Daniels at Acm.Org




More information about the Python-list mailing list