Package for listing version of packages used in a Jupyter notebook

前端 未结 7 1151
遥遥无期
遥遥无期 2020-12-13 19:50

I seem to remember there is a package that printed the versions and relevant information about Python packages used in a Jupyter notebook so the results in it were reproduci

相关标签:
7条回答
  • 2020-12-13 20:50

    One-liner:

    # In[1]:
    import pandas as pd
    import numpy as np
    import tensorflow as tf
    
    print('\n'.join(f'{m.__name__} {m.__version__}' for m in globals().values() if getattr(m, '__version__', None)))
    

    Output:

    pandas 1.1.1
    numpy 1.19.1
    tensorflow 2.2.0
    
    0 讨论(0)
提交回复
热议问题