<@ULVA73B9P> is python 3.13 supported in prefect c...
# ask-marvin
r
@Marvin is python 3.13 supported in prefect cloud like
Copy code
"prefecthq/prefect-client:3-latest"
m
thought for 114.9 seconds
Short answer: Prefect Cloud is agnostic to your Python version — if your flow runs in a container with Python 3.13 and a compatible Prefect 3.x, Cloud is fine with it. However, our official Docker images tagged with 3.x “latest” are currently built on Python 3.12, not 3.13. - There is not (yet) a Python 3.13 variant of the official images; attempting to auto-select a 3.13-tagged image can fail because the manifest doesn’t exist. See: Prefect auto-generate docker file on deploy unstable If you need Python 3.13 today, use a custom image for your deployments/work pool:
Copy code
# Dockerfile
FROM python:3.13-slim
ENV PIP_NO_CACHE_DIR=1
RUN pip install --upgrade pip
RUN pip install prefect
# plus your dependencies
WORKDIR /app
COPY . /app
Then reference it in your deployment:
Copy code
from prefect import flow

@flow
def my_flow():
    ...

if __name__ == "__main__":
    my_flow.deploy(
        name="my-deployment",
        work_pool_name="my-pool",
        image="yourrepo/yourimage:py3.13",
        build=False,
        push=False,
    )
Two quick clarifications to make sure we point you to the right thing: - Did you mean
prefecthq/prefect:3-latest
? We don’t typically publish a
prefecthq/prefect-client
image; the common base image is
prefecthq/prefect
. - Do you want to rely on an official prebuilt image, or are you okay building/using a custom one for 3.13?
r
@Marvin i mean for prefect managed infrastructure work pool
m
thought for 96.9 seconds
Got it — for a Prefect Managed Infrastructure work pool: - Managed’s default image (the “Prefect managed” option) currently uses our official Prefect 3 image based on Python 3.12. There isn’t a 3.13 variant of the official image yet. - You can still run Python 3.13 on Managed by supplying your own Docker image in the deployment. Managed will pull and run whatever image you specify. Heads-up: if you let Prefect “auto” choose an image while you’re on Python 3.13, it may try to use a non-existent tag and fail. See: Issue #17615 What to do 1) Build/push a 3.13 image:
Copy code
# Dockerfile
FROM python:3.13-slim
ENV PIP_NO_CACHE_DIR=1
RUN pip install --upgrade pip && pip install prefect
# add your deps + code
WORKDIR /app
COPY . /app
2) Point your deployment at that image (don’t rely on auto):
Copy code
from prefect import flow
from prefect.docker import DockerImage

@flow
def my_flow():
    ...

if __name__ == "__main__":
    my_flow.deploy(
        name="my-deployment",
        work_pool_name="my-managed-pool",
        image=DockerImage(name="yourrepo/yourimage", tag="py3.13"),
        build=False,
        push=False,
    )
If your registry is private, make sure Managed has credentials to pull it. Docs: Managed infrastructure guide Does that work for your setup, or do you want help wiring private registry credentials for the Managed pool?