list versions of all installed modules

Scott David Daniels Scott.Daniels at Acm.Org
Tue Oct 28 17:26:08 CET 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