Skip to content
Latchkey

python --version: Check the Active Interpreter

Confirm which Python a CI step is actually running.

python --version prints the interpreter version. Verifying it at the top of a job catches the wrong-Python class of CI failures before they waste a whole run.

What it does

Prints the running interpreter’s version (e.g. "Python 3.11.9"). -V is the short form; -VV prints additional build information.

Common usage

Terminal
python --version
python -V
python -VV
python3.11 --version

Common CI use: assert the version

When a matrix builds against several Pythons, confirm the active one matches expectations before installing, so a setup misfire fails loudly instead of silently using the wrong interpreter.

Terminal
python --version
python -c "import sys; assert sys.version_info[:2] == (3, 11), sys.version"

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →