How to get a list of python modules (with version for …
https://moonbooks.org/Articles/How-to-get-a-list-of-python-modules-with-versions-and-create-a-requirementstxt-file-/
Sep 26, 2020 · In a jupyter notebook to get a list of python modules used, a solution is to enter in a cell the following lines: import types def imports (): for name, val in globals ().items (): if isinstance (val, types.ModuleType): yield val.__name__ list (imports ()) returns for example: ['builtins', 'builtins', 'types', 'tensorflow', 'tensorflow_docs', 'tensorflow_docs', 'matplotlib.pyplot', …
DA: 57 PA: 68 MOZ Rank: 70