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__))

输出:

 

posted @ 2020-01-11 18:46  赏尔  阅读(4583)  评论(0编辑  收藏  举报