Registry / workflow / prefect-cloud

prefect-cloud

JSON →
library0.1.10pypypiunverified

Prefect-cloud is a Python package providing a command-line interface (CLI) to easily deploy and run Python functions and workflows to Prefect Cloud. It streamlines the process of getting your data pipelines orchestrated and monitored in a serverless environment. The current version is 0.1.10, and it maintains an active release cadence with regular updates.

pip install prefect-cloud
INSTALL
IMPORT
SIG · PREFECT-CLOUD
P
prefect-cloud
workflowpythonv0.1.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

To use `prefect-cloud`, you first define your workflows using the `prefect` library's `@flow` and `@task` decorators. After developing your flow (e.g., in a file named `hello_flow.py`) and pushing it to a GitHub repository, you can deploy it to Prefect Cloud using the `uvx prefect-cloud deploy` command. This command uploads your flow, creates a deployment, and can optionally schedule its execution. Before deploying, ensure you've logged into Prefect Cloud using `uvx prefect cloud login`.

# hello_flow.py from prefect import flow, task @task def say_hello(name: str) -> str: print(f"Hello, {name}!") return f"Said hello to {name}" @flow(name="My Cloud Hello Flow") def hello_world_flow(target_name: str = "World"): result = say_hello(target_name) print(f"Task result: {result}") # To deploy: save this file, commit to a GitHub repo (e.g., your-username/your-repo/flows/hello_flow.py) # Then run the CLI command below. # CLI command (after logging into Prefect Cloud via 'uvx prefect cloud login'): # uvx prefect-cloud deploy hello_world_flow --from https://github.com/your-username/your-repo/blob/main/flows/hello_flow.py --name "Hello Deployment" --schedule "0 0 * * *"
prefect-cloud --version
Debug
Known issues
breakingPrefect 1.x flows are incompatible with Prefect 2.x and, by extension, `prefect-cloud`. If migrating from Prefect 1.x, significant code changes are required to adapt to the Prefect 2.x API.
fix
Rewrite flows to conform to the Prefect 2.x API (using `@flow` and `@task` decorators from the `prefect` library). Refer to the Prefect 2.x migration guide.
affects: All versions of `prefect-cloud` (which targets Prefect 2.x+)
gotchaIncorrect or missing `PREFECT_API_KEY` or `PREFECT_API_URL` environment variables can lead to authentication or connection failures when deploying or running flows with Prefect Cloud.
fix
Ensure `PREFECT_API_KEY` is set to a valid API key from your Prefect Cloud workspace and `PREFECT_API_URL` points to your Prefect Cloud API (e.g., `https://api.prefect.cloud/api/...`). Use `uvx prefect cloud login` to set up your profile correctly.
affects: All versions
gotchaWhen deploying flows with `prefect-cloud`, any external Python dependencies required by your flow must be explicitly declared, either via `--dependencies` arguments or by referencing a `requirements.txt` file in your repository.
fix
Add `--dependencies 'package1,package2'` or `--dependencies /path/to/requirements.txt` to your `uvx prefect-cloud deploy` command.
affects: All versions
gotchaExcessive logging or passing very large data objects directly between tasks in Prefect flows can lead to performance bottlenecks, increased resource consumption, and higher costs in cloud environments, even with serverless execution.
fix
Optimize logging verbosity. For large data, consider using external storage (e.g., S3, GCS) and passing references (paths/keys) between tasks instead of the raw data.
affects: All versions
gotchaIncompatibility between your locally installed `prefect` and `prefect-cloud` versions and the Prefect Cloud server can cause unexpected errors or deployment failures.
fix
Always keep your local `prefect` and `prefect-cloud` installations up-to-date and compatible with the Prefect Cloud service. Check release notes for any specific version requirements.
affects: All versions
Errors
Common errors & fixes
Unable to authenticate with Prefect Cloud. Your key is not in our expected format.
This error occurs when the Prefect CLI or client attempts to authenticate with Prefect Cloud using an invalid, expired, or incorrectly formatted API key. It can also happen when trying to use a Prefect 1.x API key with Prefect 2.x Cloud.
fix
Generate a new Prefect Cloud 2.x API key from the Prefect Cloud UI. Then, set it using the CLI with `prefect cloud login --key <YOUR_API_KEY>` or by setting the `PREFECT_API_KEY` environment variable. Ensure the key starts with 'pnu_' or 'pnb_'.
ModuleNotFoundError: No module named 'your_module_name'
This error indicates that a Python module required by your Prefect flow is not installed or available in the execution environment where the flow is running (e.g., within a Docker image, on a worker, or in the serverless environment).
fix
Ensure that all necessary Python packages are listed in your `requirements.txt` file and are installed in the Docker image or the execution environment where your Prefect worker operates. If using a custom Docker image, verify that the `Dockerfile` includes the installation of all dependencies.
FileNotFoundError: [Errno 2] No such file or directory: '...'
This error typically occurs during flow deployment or execution when the flow tries to access a file or directory that is present in the local development environment but is missing from the deployed execution environment (e.g., a virtual environment path, a local script, or data file).
fix
Verify that all required files and directories are correctly packaged and transferred to the deployment environment. If using Docker, ensure your `Dockerfile` copies these assets correctly. Avoid hardcoding local development paths. For virtual environment issues, ensure the deployed environment can locate Python interpreters and scripts without relying on local virtual environment paths.
No such command '...'
This error means that the Prefect CLI command you are trying to execute is either misspelled, deprecated, or does not exist in the version of Prefect you have installed. This often happens when mixing Prefect 1.x and Prefect 2.x commands.
fix
Consult the official Prefect 2.x documentation for the correct and up-to-date CLI commands. Ensure your `prefect` installation is the correct version and is up-to-date by running `pip install --upgrade prefect`. If specific commands like 'database' are not found, it might indicate a command that was removed or replaced in Prefect 2.x.
Upgrade
Version history
0.1.10latest on PyPI · released Feb 3, 2026
Audit
Dependencies
prefectrequiredRequired for defining flows and tasks that prefect-cloud deploys. Requires Python >=3.10.
Agent activity
27 hits · last 30 days
node
22
Amazon
1
OpenAI (training)
1
Resources
prefect-cloud — pip install prefect-cloud · libregistry