Skip to content

Installing Python

If Python is already installed on your system, fyn will detect and use it without configuration. However, fyn can also install and manage Python versions. fyn automatically installs missing Python versions as needed — you don't need to install Python to get started.

Getting started

To install the latest Python version:

$ fyn python install

Note

Python does not publish official distributable binaries. As such, fyn uses distributions from the Astral python-build-standalone project. See the Python distributions documentation for more details.

Once Python is installed, it will be used by fyn commands automatically. fyn also adds the installed version to your PATH:

$ python3.13

fyn only installs a versioned executable by default. To install python and python3 executables, include the --default option:

$ fyn python install --default

Tip

See the documentation on installing Python executables for more details.

Installing a specific version

To install a specific Python version:

$ fyn python install 3.12

To install multiple Python versions:

$ fyn python install 3.11 3.12

To install an alternative Python implementation, e.g., PyPy:

$ fyn python install pypy@3.10

See the python install documentation for more details.

Reinstalling Python

To reinstall fyn-managed Python versions, use --reinstall, e.g.:

$ fyn python install --reinstall

This will reinstall all previously installed Python versions. Improvements are constantly being added to the Python distributions, so reinstalling may resolve bugs even if the Python version does not change.

Viewing Python installations

To view available and installed Python versions:

$ fyn python list

See the python list documentation for more details.

Automatic Python downloads

Python does not need to be explicitly installed to use fyn. By default, fyn will automatically download Python versions when they are required. For example, the following would download Python 3.12 if it was not installed:

$ fynx python@3.12 -c "print('hello world')"

Even if a specific Python version is not requested, fyn will download the latest version on demand. For example, if there are no Python versions on your system, the following will install Python before creating a new virtual environment:

$ fyn venv

Tip

Automatic Python downloads can be easily disabled if you want more control over when Python is downloaded.

Note that when an automatic Python installation occurs, the python command will not be added to the shell. Use fyn python install-shim to ensure the python shim is installed.

Using existing Python versions

fyn will use existing Python installations if present on your system. There is no configuration necessary for this behavior: fyn will use the system Python if it satisfies the requirements of the command invocation. See the Python discovery documentation for details.

To force fyn to use the system Python, provide the --no-managed-python flag. See the Python version preference documentation for more details.

Upgrading Python versions

Important

Support for upgrading Python patch versions is in preview. This means the behavior is experimental and subject to change.

To upgrade a Python version to the latest supported patch release:

$ fyn python upgrade 3.12

To upgrade all fyn-managed Python versions:

$ fyn python upgrade

See the python upgrade documentation for more details.

Next steps

To learn more about fyn python, see the Python version concept page and the command reference.

Or, read on to learn how to run scripts and invoke Python with fyn.