The .python-version file is a small but essential configuration file used by popular Python version managers like and asdf . Its primary role is to specify which version of Python should be automatically activated when you enter a specific project directory. Why Use a .python-version File?
my_project/ ├── .python-version <-- Here ├── .gitignore ├── pyproject.toml ├── src/ │ └── my_package/ └── tests/ .python version
sudo apt update sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt install python3.9 pyenv The
# Install Python 3.10 using pyenv pyenv install 3.10.0 .python version