Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package for listing version of packages used in a Jupyter notebook

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 reproducible. But I cannot remember the name of the package. Can any of you point me in the right direction?

Thanks in advance!

like image 708
msx Avatar asked Nov 04 '16 17:11

msx


People also ask

What version of Python package do I have Jupyter notebook?

To check the Python version in your Jupyter notebook, first import the python_version function with “ from platform import python_version “. Then call the function python_version() that returns a string with the version number running in your Jupyter notebook such as "3.7. 11" .

How do I list installed packages in Python?

The Pip, Pipenv, Anaconda Navigator, and Conda Package Managers can all be used to list installed Python packages. You can also use the ActiveState Platform's command line interface (CLI), the State Tool to list all installed packages using a simple “state packages” command.


1 Answers

This gets all the installed packages

import pip #needed to use the pip functions for i in pip.get_installed_distributions(local_only=True):     print(i) 

To get the list of packages from current notebook

import types def imports():     for name, val in globals().items():         if isinstance(val, types.ModuleType):             yield val.__name__ list(imports()) 
like image 183
Vivek Srinivasan Avatar answered Sep 19 '22 08:09

Vivek Srinivasan