Chris Marriott
06/23/2026, 1:13 PMImportError: cannot import name 'PREFECT_SERVER_API_WEBSOCKET_PING_INTERVAL' from 'prefect.settings'
Marvin
06/23/2026, 1:13 PMMarvin
06/23/2026, 1:16 PMPREFECT_SERVER_API_WEBSOCKET_PING_INTERVAL is a newer setting. If something in your server startup path is trying to import it, but the installed prefect package is older, startup will fail with exactly that ImportError.
Most likely causes
- You upgraded or changed some server-related code/image, but not the installed prefect package
- You have a partial/broken environment or mixed site-packages
- In Docker, your image layers are out of sync
- You're running code from a newer Prefect checkout against an older installed version
What to check first
bash
python -c "import prefect; print(prefect.__version__)"
That setting is available in newer 3.x releases, but not in older 3.6.x installs. So if you see something like 3.6.x, that's probably the issue.
Fix
Upgrade Prefect so the code and settings model match:
bash
pip install --upgrade "prefect>=3.7.3"
Then verify the import works:
bash
python -c "from prefect.settings import PREFECT_SERVER_API_WEBSOCKET_PING_INTERVAL; print(PREFECT_SERVER_API_WEBSOCKET_PING_INTERVAL.value())"
If this started “suddenly”
That often points to one of these:
- a fresh rebuild pulled a newer startup script
- a dependency/image changed underneath you
- a deploy reused an old environment with newer Prefect server code
If you're using Docker
Make sure the image itself has the right Prefect version installed, not just your local environment.
Relevant docs:
- Prefect docs
- Prefect GitHub repo
If you want, I can help you pinpoint it from:
- your prefect version
- how you start the server
- whether this is local, Docker, or Kubernetes