Ihor Ramskyi
06/18/2026, 4:12 PMprefect version fails
Name: prefect
Version: 3.6.28
Summary: Workflow orchestration and management.
Home-page:
Author:
Author-email: "Prefect Technologies, Inc." <help@prefect.io>
License: Apache-2.0
Location: /nfs/ub-03/iramskyi/Projects/Prefect/venv/lib/python3.10/site-packages
Requires: aiosqlite, alembic, amplitude-analytics, anyio, apprise, asgi-lifespan, asyncpg, cachetools, click, cloudpickle, coolname, cryptography, cyclopts, dateparser, docker, exceptiongroup, fastapi, fsspec, graphviz, griffe, httpcore, httpx, humanize, jinja2, jinja2-humanize-extension, jsonpatch, jsonschema, opentelemetry-api, orjson, packaging, pathspec, pendulum, pluggy, prometheus-client, pydantic, pydantic-core, pydantic-extra-types, pydantic-settings, pydocket, python-dateutil, python-slugify, pytz, pyyaml, readchar, rfc3339-validator, rich, ruamel-yaml, ruamel-yaml-clib, semver, sniffio, sqlalchemy, toml, typing-extensions, uvicorn, websockets
Required-by:Marvin
06/18/2026, 4:12 PMMarvin
06/18/2026, 4:15 PM3.6.28.
What’s happening
Prefect 3.6.28 imports importlib_metadata directly in prefect/workers/base.py, but that package is not listed as an install requirement. On Python 3.10, that’s especially incorrect because the stdlib module importlib.metadata should be used instead.
The problematic import is effectively:
from importlib_metadata import distributions
But for Python 3.10+, it should be:
from importlib.metadata import distributions
Why prefect version can fail
Although prefect version itself uses the stdlib import correctly in the CLI code, importing other Prefect modules can still trigger the bad import path from workers/base.py, causing the command to fail if importlib_metadata is not installed.
Confirmed status
This was fixed upstream in Prefect `3.7.2`:
PR #22012 - use stdlib importlib.metadata instead of importlib_metadata backport
Recommended fix
Upgrade Prefect:
pip install --upgrade 'prefect>=3.7.2'
Temporary workaround
If you need to stay on 3.6.28, install the backport explicitly:
pip install importlib-metadata
Summary
- prefect 3.6.28 has an undeclared dependency bug
- importlib_metadata is imported unconditionally in workers/base.py
- On Python 3.10+, this should use importlib.metadata
- Fixed in 3.7.2+
If you want, I can also help you identify the exact import chain that makes prefect version hit workers/base.py in your environment.