代码:
import sys, matplotlib, sklearn, IPython
import numpy as np, pandas as pd, scipy as sp
modules = {‘NumPy‘: np, ‘pandas‘: pd, ‘scikit-learn‘: sklearn,
‘scipy‘: sp, ‘matplotlib‘: matplotlib, ‘IPython‘: IPython}
print(‘Python version: %s‘ % (sys.version))
for i in modules.items():
print(‘{} version: {}‘.format(i[0], i[1].__version__))
输出: