: Hardcodes the version in the FROM instruction of a Dockerfile .

: The file contains a single string of text, such as 3.11.4 .

: Defines the required Python version range in the pyproject.toml file under the [tool.poetry.dependencies] section.

While .python-version is the standard for pyenv , other tools have different methods:

When you enter a directory in your terminal, the version manager checks for this hidden file.

: Follow the installation guide on the pyenv GitHub repository.