session-info2¶
cli¶
!session-info -h
usage: session-info [-h] [--os | --no-os] [--cpu | --no-cpu] [--gpu | --no-gpu]
[--dependencies | --no-dependencies] [-f {}]
[packages ...]
positional arguments:
packages packages to import
options:
-h, --help show this help message and exit
--os, --no-os include OS name and version
--cpu, --no-cpu include number of CPU cores
--gpu, --no-gpu include information per supported GPU (disabled by default)
--dependencies, --no-dependencies
include dependencies
-f, --format {} output format
!session-info --no-dependencies ipykernel
ipykernel 7.4.0
---- ----
Python 3.14.6 (main, Jun 25 2026, 17:44:13) [GCC 15.2.0]
OS Linux-7.0.0-1004-aws-x86_64-with-glibc2.43
CPU 2/2 logical CPU cores
Updated 2026-10-02 08:56
programmatic use¶
Start by importing the main function and calling it:
from session_info2 import session_info
session_info() # note that the “copy” button only works in a live notebook
If you call it while some packages are in scope, you should see them appear in the list:
session_info()
In environments where ipywidgets is not available, you will see the HTML version of the output instead:
from IPython.display import HTML
HTML(session_info()._repr_mimebundle_()["text/html"])
| Component | Info |
|---|---|
| Python | 3.14.6 (main, Jun 25 2026, 17:44:13) [GCC 15.2.0] |
| OS | Linux-7.0.0-1004-aws-x86_64-with-glibc2.43 |
| Updated | 2026-10-02 08:56 |
Dependencies
| Dependency | Version |
|---|---|
| tornado | 6.5.10 |
| jupyter_core | 5.9.1 |
| comm | 0.2.3 |
| debugpy | 1.8.22 |
| pexpect | 4.9.0 |
| Pygments | 2.21.0 |
| platformdirs | 4.12.2 |
| python-dateutil | 2.9.0.post0 |
| ipykernel | 7.4.0 |
| ptyprocess | 0.7.0 |
| session-info2 | 0.4.3.dev12+g12ae02f5c |
| traitlets | 5.16.1 |
| psutil | 7.2.2 |
| typing_extensions | 4.16.0 |
| pyzmq | 27.2.0 |
| packaging | 26.3 |
| jupyter_client | 8.10.0 |
| ipywidgets | 8.1.9 |
| ipython | 9.17.1 |
| six | 1.17.0 |
Copyable Markdown
| Dependency | Version | | ----------------- | ---------------------- | | tornado | 6.5.10 | | jupyter_core | 5.9.1 | | comm | 0.2.3 | | debugpy | 1.8.22 | | pexpect | 4.9.0 | | Pygments | 2.21.0 | | platformdirs | 4.12.2 | | python-dateutil | 2.9.0.post0 | | ipykernel | 7.4.0 | | ptyprocess | 0.7.0 | | session-info2 | 0.4.3.dev12+g12ae02f5c | | traitlets | 5.16.1 | | psutil | 7.2.2 | | typing_extensions | 4.16.0 | | pyzmq | 27.2.0 | | packaging | 26.3 | | jupyter_client | 8.10.0 | | ipywidgets | 8.1.9 | | ipython | 9.17.1 | | six | 1.17.0 | | Component | Info | | --------- | ------------------------------------------------- | | Python | 3.14.6 (main, Jun 25 2026, 17:44:13) [GCC 15.2.0] | | OS | Linux-7.0.0-1004-aws-x86_64-with-glibc2.43 | | Updated | 2026-10-02 08:56 |
Compare the output with session-info:
import session_info as si
si.show()
Click to view session information
----- session_info v1.0.1 session_info2 NA -----
Click to view modules imported as dependencies
comm 0.2.3 cython_runtime NA dateutil 2.9.0.post0 debugpy 1.8.22 ipykernel 7.4.0 ipywidgets 8.1.9 packaging 26.3 pexpect 4.9.0 platformdirs 4.12.2 psutil 7.2.2 ptyprocess 0.7.0 pydev_ipython NA pydevconsole NA pydevd 3.5.0 pydevd_file_utils NA pydevd_plugins NA pydevd_tracing NA pygments 2.21.0 six 1.17.0 tornado 6.5.10 traitlets 5.16.1 typing_extensions NA zmq 27.2.0
----- IPython 9.17.1 jupyter_client 8.10.0 jupyter_core 5.9.1 ----- Python 3.14.6 (main, Jun 25 2026, 17:44:13) [GCC 15.2.0] Linux-7.0.0-1004-aws-x86_64-with-glibc2.43 ----- Session information updated at 2026-10-02 08:56