Skip to content
Latchkey

poetry env use: Select the Python Interpreter

Pin the Python version Poetry builds its environment with.

poetry env use tells Poetry which Python interpreter to create or use for the project environment. A CI matrix uses it to target each Python version explicitly.

What it does

Creates (or switches to) a project virtual environment backed by the named interpreter. Accepts a version like 3.11, a full path, or "system".

Common usage

Terminal
poetry env use 3.11
poetry env use /usr/bin/python3.12
poetry env use python3.11
poetry env info

Common CI error: interpreter not found

If the requested Python is not installed on the runner, poetry env use fails. Install or set up that Python (e.g. via setup-python) before selecting it.

Terminal
# Failure:
# Could not find the python executable python3.11

# Fix: ensure the interpreter exists first, then:
poetry env use 3.11

Related guides

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