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.3.0
----	----
Python	3.14.6 (main, Jun 25 2026, 18:32:52) [GCC 13.2.0]
OS	Linux-7.0.0-1004-aws-x86_64-with-glibc2.39
CPU	2/2 logical CPU cores, x86_64
Updated	2026-08-04 09:03

programmatic use

Start by importing the main function and calling it:

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"])
ComponentInfo
Python3.14.6 (main, Jun 25 2026, 18:32:52) [GCC 13.2.0]
OSLinux-7.0.0-1004-aws-x86_64-with-glibc2.39
Updated2026-08-04 09:03
Dependencies
DependencyVersion
ipywidgets8.1.8
debugpy1.8.21
wcwidth0.8.2
pexpect4.9.0
ipython9.16.1
Pygments2.20.0
jupyter_core5.9.1
traitlets5.16.1
asttokens3.0.2
executing2.2.1
python-dateutil2.9.0.post0
typing_extensions4.16.0
tornado6.5.7
ipykernel7.3.0
session-info20.4.2
platformdirs4.11.0
prompt_toolkit3.0.53
jupyter_client8.9.1
comm0.2.3
ptyprocess0.7.0
pure_eval0.2.3
six1.17.0
psutil7.2.2
packaging26.2
pyzmq27.1.0
stack-data0.6.3
Copyable Markdown
| Dependency        | Version     |
| ----------------- | ----------- |
| ipywidgets        | 8.1.8       |
| debugpy           | 1.8.21      |
| wcwidth           | 0.8.2       |
| pexpect           | 4.9.0       |
| ipython           | 9.16.1      |
| Pygments          | 2.20.0      |
| jupyter_core      | 5.9.1       |
| traitlets         | 5.16.1      |
| asttokens         | 3.0.2       |
| executing         | 2.2.1       |
| python-dateutil   | 2.9.0.post0 |
| typing_extensions | 4.16.0      |
| tornado           | 6.5.7       |
| ipykernel         | 7.3.0       |
| session-info2     | 0.4.2       |
| platformdirs      | 4.11.0      |
| prompt_toolkit    | 3.0.53      |
| jupyter_client    | 8.9.1       |
| comm              | 0.2.3       |
| ptyprocess        | 0.7.0       |
| pure_eval         | 0.2.3       |
| six               | 1.17.0      |
| psutil            | 7.2.2       |
| packaging         | 26.2        |
| pyzmq             | 27.1.0      |
| stack-data        | 0.6.3       |

| Component | Info                                              |
| --------- | ------------------------------------------------- |
| Python    | 3.14.6 (main, Jun 25 2026, 18:32:52) [GCC 13.2.0] |
| OS        | Linux-7.0.0-1004-aws-x86_64-with-glibc2.39        |
| Updated   | 2026-08-04 09:03                                  |

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
asttokens           NA
comm                0.2.3
cython_runtime      NA
dateutil            2.9.0.post0
debugpy             1.8.21
executing           2.2.1
ipykernel           7.3.0
ipywidgets          8.1.8
packaging           26.2
pexpect             4.9.0
platformdirs        4.11.0
prompt_toolkit      3.0.53
psutil              7.2.2
ptyprocess          0.7.0
pure_eval           0.2.3
pydev_ipython       NA
pydevconsole        NA
pydevd              3.4.1
pydevd_file_utils   NA
pydevd_plugins      NA
pydevd_tracing      NA
pygments            2.20.0
six                 1.17.0
stack_data          0.6.3
tornado             6.5.7
traitlets           5.16.1
typing_extensions   NA
wcwidth             0.8.2
zmq                 27.1.0
-----
IPython             9.16.1
jupyter_client      8.9.1
jupyter_core        5.9.1
-----
Python 3.14.6 (main, Jun 25 2026, 18:32:52) [GCC 13.2.0]
Linux-7.0.0-1004-aws-x86_64-with-glibc2.39
-----
Session information updated at 2026-08-04 09:03