session-info
The `session-info` Python library (module name `session_info`) provides a simple way to output version information for modules loaded in the current session, Python interpreter, operating system, and CPU. It aims to improve reproducibility, especially in interactive environments like Jupyter notebooks. The current version is 1.0.1, released in May 2021, suggesting an infrequent release cadence for this specific package.
Warnings
- breaking The package was renamed from `sinfo` to `session-info` (with the primary module becoming `session_info`). While the old `sinfo` PyPI package is kept for backward compatibility, new features and bug fixes are only applied to `session-info`. Users should migrate to the new package.
- gotcha By default, `session_info.show()` only lists third-party packages. Standard library modules (e.g., `math`, `os`) are omitted from the output.
- gotcha The `session_info.show()` function, by default, only lists explicitly imported top-level modules. It does not automatically show their internal or recursive dependencies.
- gotcha When used within a Jupyter Notebook, `session_info.show()` renders its output with HTML formatting by default. If plain text output is preferred, this needs to be explicitly specified.
- gotcha This specific `session-info` package (v1.0.1) does not provide a direct function to save its output to a file (e.g., `to_file()`). Users often expect this functionality for sharing or logging.
- gotcha There is a similarly named, more recently updated Python package called `session-info2` (latest v0.4, Feb 2026). It uses a different import pattern (`from session_info2 import session_info`). Ensure you install and import the correct package if aiming for `session-info` (v1.0.1).
Install
-
pip install session-info -
conda install -c conda-forge session-info
Imports
- session_info
import session_info
Quickstart
import pandas import numpy import session_info # Basic usage to show loaded third-party modules, Python, and OS info session_info.show() # To include standard library modules (e.g., 'math') # import math # session_info.show(std_lib=True) # To include recursive dependencies of imported modules # session_info.show(dependencies=True)