session-info2
Print versions of imported packages.
What it is and what it does
session-info2 is a utility for capturing and printing the versions of all packages imported in your Python environment. It works both as a command-line tool and as a library you can call from scripts or notebooks. The core use case is documenting your environment's dependency state for reproducibility—particularly useful in Jupyter notebooks where you want to record what versions were active when you ran an analysis.
The package has no runtime dependencies and works by introspecting the imported modules in your current session. You can call it with options to include or exclude OS info, list indirect dependencies, or format the output in different ways. It supports Python 3.12 and later, including PyPy, and is actively maintained.
Use it for:
- Document the exact package versions used in a Jupyter notebook for reproducibility and sharing.
- Generate a dependency snapshot at the start of a script to include in logs or reports.
- Verify that a specific package version is loaded in your current session before running code.
- Compare environment states across different machines or CI/CD runs by capturing session info at key points.
- Include environment metadata in bug reports or issue discussions to help others reproduce problems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Captures and displays the versions of all imported packages in your Python environment, useful for documenting reproducible setups in notebooks and scripts.
Yes. Low install friction, no dependencies, active maintenance, and no known vulnerabilities. The copyleft license (MPL-2.0) is permissive for use and modification. Useful for anyone working in notebooks or scripts who needs to track or document their environment state.
Install
session-info2 on PyPI
pip
pip install session-info2uv
uv add session-info2poetry
poetry add session-info2Installing session-info2
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance with last commit 2026-08-11. Requires Python 3.12 or later.
License in practice
Licensed under MPL-2.0 (copyleft). You may use and modify the package freely, but any modifications must be released under the same license if distributed.
Quickstart
pip install session-info2
from session_info2 import session_info
session_info()
Requires Python 3.12 or later.
Verify before relying
- Whether the CLI tool (`session-info` command) works identically to the programmatic API or has different output modes.
- How the package handles packages installed in editable mode or from non-standard sources.
- Performance characteristics when run on environments with hundreds of installed packages.
Package facts
| License | MPL-2.0 (copyleft) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 10 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,055,275/month — #4,433 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: session_info2-0.4.2-py3-none-any.whl
Keywords: jupyter, session-info
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
session-infoOutputs version information for all modules…
permissive · top 15,000 on PyPI
ipynbImports Jupyter Notebook (.ipynb) files as…
permissive · top 15,000 on PyPI
importnbimportnb lets you import Jupyter notebooks as…
permissive · top 15,000 on PyPI
jupytextJupytext converts Jupyter notebooks to and from…
permissive · top 5,000 on PyPI
scoobyScooby generates formatted reports of your…
permissive · top 5,000 on PyPI
ipynbnameReturns the filename or full path of the…
permissive · top 15,000 on PyPI
nb-cleannb-clean removes execution counts, metadata,…
permissive · top 15,000 on PyPI
mkdocs-jupyterConverts Jupyter notebooks and Python scripts…
permissive · top 15,000 on PyPI
semantic-versionParses, validates, and compares semantic…
permissive · top 1,000 on PyPI
jupyterJupyter is a metapackage that installs the core…
permissive · top 5,000 on PyPI