.python Version Upd ⇒ ❲Proven❳

python-3.11.5 Note: Heroku requires the python- prefix on the version string. Render reads .python-version directly. No prefix needed. Vercel (Serverless Functions) Vercel respects .python-version for Python serverless functions. Supported versions: 3.9, 3.10, 3.11. GitHub Actions In your CI pipeline, you can read the file dynamically:

docker build --build-arg PYTHON_VERSION=$(cat .python-version) . Despite its simplicity, .python-version supports several useful syntax patterns: Exact Version 3.11.5 Use this for production projects. It guarantees bytecode compatibility. Major Version Alias 3.11 pyenv will use the latest installed 3.11.x version. Useful for libraries or tools that claim compatibility with a minor release. "System" Fallback system Tells pyenv to skip its own shims and use the system Python (e.g., /usr/bin/python ). Dangerous for production but sometimes used for system scripts. Multiple Versions (Experimental) 3.11.5 3.10.4 Some tools support a space-separated list, which sets up a "virtual environment" combining both interpreters (for tox or cross-version testing). However, this is not widely supported. Comments and Blank Lines Stick to one line. Most tools ignore blank lines, but comments ( # ) are not officially supported. Keep it clean. 8. Project Structure: Where to Place the File The .python-version file should be placed in the root directory of your Python project—the same folder containing pyproject.toml , setup.py , or requirements.txt . .python version

By combining .python-version with a .envrc file, you can fully automate environment setup: python-3

pyenv install --list If the requested version isn't installed, pyenv will warn you: Vercel (Serverless Functions) Vercel respects