<@ULVA73B9P> how do i specify multiple extra pip p...
# ask-marvin
f
@Marvin how do i specify multiple extra pip packages on a deployment job variable?
m
thought for 237.2 seconds
Great question — it depends on the work pool type you’re deploying to. In Prefect 3.x, there are two common patterns: - Managed work pool (Prefect-managed infrastructure): use a list field named
pip_packages
- Container/pull workers (Docker, Kubernetes, ECS/EC2): set the
EXTRA_PIP_PACKAGES
env var as a space-separated string Examples: 1) Managed work pool (list)
Copy code
flow.from_source("<https://github.com/org/repo>").deploy(
  name="my-deployment",
  work_pool_name="my-managed-pool",
  job_variables={
    "pip_packages": [
      "pandas==2.2.*",
      "numpy>=1.26",
      "prefect-aws"
    ]
  },
)
2) Container workers (space-separated string via env)
Copy code
flow.from_source("<https://github.com/org/repo>").deploy(
  name="my-deployment",
  work_pool_name="my-k8s-pool",
  job_variables={
    "env": {
      "EXTRA_PIP_PACKAGES": "pandas==2.2.* numpy>=1.26 prefect-aws"
    }
  },
)
Notes: - You can include version pins and extras (e.g.,
package[extra1,extra2]==1.0.0
). - If you’re using a custom image, it’s best to bake dependencies into the image;
EXTRA_PIP_PACKAGES
is handy for quick additions. Docs: - Customize job variables - Managed work pools - Kubernetes worker example Which work pool type are you using? I can tailor the exact
job_variables
for your setup.