Jagi Natarajan
11/12/2024, 8:07 PMMarvin
11/12/2024, 8:08 PMNotImplementedError
you've encountered, particularly when using Python 3.11 with Prefect. This issue tends to occur in environments where the async event loop's "child watcher" mechanism is not implemented, which can happen if you're running Prefect in certain setups.
1. GitHub Issues: There are a couple of related issues on GitHub. One involves Prefect's webserver functionality, where tasks fail to start if webserver=True
is used. The workaround suggested involves patching the server log level temporarily. (See here and here for more details.)
2. Compatibility with uvloop
: There's another issue with Prefect 2.x and newer versions of uvloop
. Downgrading uvloop
or avoiding its installation might be a temporary fix if you use it.
To address this issue, consider the following:
- Environment Setup: Ensure that uvloop
(if used) is compatible, or try using standard Python asyncio event loop as an alternative.
- Patch Workaround: Apply the patch mentioned in the GitHub issue if your use case involves serving flows via a webserver.
- Python Version: Although Python 3.11 is quite new, consider reverting to a more widely supported version like Python 3.10 where these issues might be less prevalent.
For more details, you can check out the specific issues on GitHub: Issue 15733, Issue 13588.
If you're as lucky as Marvin from Hitchhiker's Guide to the Galaxy, this little adventure with Prefect might just be a deceptively complex puzzle that adds a twist to your day. But, no worries, every bug is another step towards prefect... I mean, perfect code.