Registry / devops / session-info

session-info

JSON →
library1.0.1pypypi✓ verified 23d ago

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.

pip install session-info
INSTALL
IMPORT
SIG · SESSION-INFO
S
session-info
devopspythonv1.0.1
Install
1.6s avg
Import
95ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.100s · 18.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.090s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

session_info
import session_info
from session_info import session_info
The package installs a module named `session_info`, which is then imported directly.

This quickstart demonstrates the basic use of `session_info.show()` to print environmental and module version details. It also highlights common optional arguments like `std_lib` to include standard library modules and `dependencies` to show sub-dependencies.

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)
Debug
Known issues
breakingThe 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.
fix
Uninstall `sinfo` and install `session-info` using `pip install session-info`. Update imports from `from sinfo import sinfo` to `import session_info` and function calls from `sinfo()` to `session_info.show()`.
affects: <1.0.0 (sinfo)
gotchaBy default, `session_info.show()` only lists third-party packages. Standard library modules (e.g., `math`, `os`) are omitted from the output.
fix
To include standard library modules in the output, call `session_info.show(std_lib=True)`.
affects: 1.0.0+
gotchaThe `session_info.show()` function, by default, only lists explicitly imported top-level modules. It does not automatically show their internal or recursive dependencies.
fix
To include not only explicitly imported modules but also their dependencies, use `session_info.show(dependencies=True)`.
affects: 1.0.0+
gotchaWhen 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.
fix
To obtain plain text output in Jupyter Notebooks, use `session_info.show(html=False)`.
affects: 1.0.0+
gotchaThis 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.
fix
To save the output, you typically need to redirect standard output in your script (e.g., using `contextlib.redirect_stdout`) or capture the output of `session_info.show()` and write it to a file manually.
affects: 1.0.0+
gotchaThere 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).
fix
Always explicitly `pip install session-info` and use `import session_info` for this library. If you intend to use the newer library, install `session-info2` and use `from session_info2 import session_info`.
affects: All versions, due to potential confusion
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'session_info'
The 'session-info' package is not installed in your current Python environment.
fix
pip install session-info
AttributeError: module 'session_info' has no attribute 'get_info'
The 'session_info' module does not have a function or attribute named 'get_info'. The primary function to display session information is 'show()'.
fix
session_info.show()
import session-info
Python import statements do not allow hyphens in module names. The 'session-info' package is imported using its module name 'session_info' (with an underscore).
fix
import session_info
session_info.show() returns None
By default, `session_info.show()` prints the information directly to standard output and returns `None`. To capture the output as a string, you must pass `write_to_buffer=True`.
fix
info_string = session_info.show(write_to_buffer=True)
Upgrade
Version history
1.0.1latest on PyPI · released Apr 11, 2025
Audit
Dependencies
stdlib_listrequiredUsed to distinguish between standard library and third-party modules.
Agent activity
7 hits · last 30 days
node
4
OpenAI (training)
1
Resources
session-info — pip install session-info · libregistry