Python 及其第三方库的版本查看
代码:
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__))
输出:
非学无以广才,非志无以成学。