Prefect is published as a Python package, which requires Python 3.9 or newer. We recommend installing Prefect in a Python virtual environment.

To install Prefect with pip, run:

pip install -U prefect --pre

To confirm that Prefect was installed successfully, run:

prefect version

You should see output similar to:

Version:             3.0.0
API version:         0.8.4
Python version:      3.12.2
Git commit:          d6bdb075
Built:               Thu, Apr 11, 2024 6:58 PM
OS/Arch:             darwin/arm64
Profile:              local
Server type:         ephemeral
Server:
  Database:          sqlite
  SQLite version:    3.45.2

Windows installation

You can install and run Prefect via Windows PowerShell, the Windows Command Prompt, or conda. After installation, you may need to manually add the Python local packages Scripts folder to your Path environment variable.

The Scripts folder path looks something like:

C:\Users\MyUserNameHere\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts

Review the pip install output messages for the Scripts folder path on your system.

Minimal Prefect installation

The prefect-client library is a minimal installation of Prefect designed for interacting with Prefect Cloud or a remote self-hosted server instance.

prefect-client enables a subset of Prefect’s capabilities with a smaller installation size, making it ideal for use in lightweight, resource-constrained, or ephemeral environments. It omits all CLI and server components found in the prefect library.

To install the latest release of prefect-client, run:

pip install -U prefect-client

Next steps

You also need an API server, either:

Now that you have Prefect installed, go through the quickstart to try it out.

Learn more about release versions in the Prefect Release Notes.

See our Contributing guide for instructions on installing Prefect for development.