<@ULVA73B9P> why am getting this error when I run ...
# ask-marvin
t
@Marvin why am getting this error when I run my deployment in prefect managed pool:
Copy code
error: Failed to parse: `;`
  Caused by: Expected package name starting with an alphanumeric character, found `;`
Here is a sample of some of the dependencies listed in "pip_packages":
Copy code
[
  "jeepney==0.9.0 ; sys_platform == 'linux'",
    "jinja2==3.1.6",
    "jinja2-humanize-extension==0.4.0",
    "jmespath==1.1.0",
    "jsonpatch==1.33",
    "jsonpath-ng==1.7.0",
    "jsonpointer==3.0.0",
    "jsonschema==4.26.0",
    "jsonschema-specifications==2025.9.1",
]
m
thought for 209.6 seconds
That error is coming from the package parser when it encounters a semicolon in one of the entries you’ve put in
pip_packages
. In Prefect managed work pools (Prefect 3.x),
work_pool.job_variables.pip_packages
must be a list of simple, pip-installable specs (PEP 440) like
pandas
,
requests==2.31.0
,
numpy>=1.24
, etc. Environment markers (the
; ...
part from PEP 508) are not supported in
pip_packages
, which is why you’re seeing: Failed to parse:
;
Caused by: Expected package name starting with an alphanumeric character, found
;
Typical culprit examples: -
pandas; python_version >= "3.9"
-
s3fs; sys_platform == "linux"
How to fix - If you don’t need conditional installs, remove the
; ...
markers and keep plain specs:
Copy code
work_pool:
    name: my-managed-pool
    job_variables:
      pip_packages:
        - pandas==2.2.1
        - requests>=2.31.0
        - numpy
- If you do need environment markers, move them into a requirements.txt and install via a pull step in your deployment: - requirements.txt
Copy code
pandas>=2.0; python_version >= "3.9"
    s3fs; sys_platform == "linux"
- prefect.yaml
Copy code
pull:
      - prefect.deployments.steps.git_clone:
          id: clone
          repository: <https://github.com/your-org/your-repo.git>
      - prefect.deployments.steps.pip_install_requirements:
          directory: "{{ clone.directory }}"
          requirements_file: requirements.txt
    deployments:
      - name: my-managed-deployment
        entrypoint: path/to/flow.py:my_flow
        work_pool:
          name: my-managed-pool
          # You can omit pip_packages here if requirements.txt covers everything
Also double-check that
pip_packages
is a YAML list (not a single string that starts with
[
): - Correct (YAML list):
Copy code
pip_packages:
    - pandas
    - requests==2.31.0
- Incorrect (stringified JSON):
Copy code
pip_packages: "[ 'pandas', 'requests==2.31.0' ]"
If you can, please paste the actual contents of your
pip_packages
and how you’re setting them (in prefect.yaml, via
.deploy(job_variables=...)
, or in the UI). I can pinpoint the exact line that’s causing the parse error. Docs for reference: - Managed work pools: https://docs.prefect.io/v3/how-to-guides/deployment_infra/managed - Customize job variables: https://docs.prefect.io/v3/how-to-guides/deployments/customize-job-variables - prefect.yaml reference: https://docs.prefect.io/v3/how-to-guides/deployments/prefect-yaml