pyo3 icon indicating copy to clipboard operation
pyo3 copied to clipboard

Docs refer to `pyo3-asyncio` which appears to be abandoned. How to handle async in Rust for Python?

Open rjzak opened this issue 6 months ago • 1 comments

pyo3-asyncio has been untouched for two years, and has a hard dependency on a version of pyo3-ffi which is incompatible with the current version 0.25 of pyo3.

The docs https://pyo3.rs/v0.25.1/ecosystem/async-await.html point the reader to this abandoned crate.

What's the best way forward to have PyO3 work with async Tokio functions? I'm also using the experimental-async feature of pyo3 but get this error:

pyo3_runtime.PanicException: there is no reactor running, must be called from the context of a Tokio 1.x runtime

Which is the error I'm ultimately trying to solve.

rjzak avatar Jun 15 '25 16:06 rjzak

pyo3-asyncio has been untouched for two years, and has a hard dependency on a version of pyo3-ffi which is incompatible with the current version 0.25 of pyo3.

There's a maintained fork of pyo3-asyncio in PyO3/pyo3-async-runtimes that's compatible with 0.25.

The docs https://pyo3.rs/v0.25.1/ecosystem/async-await.html point the reader to this abandoned crate.

🤔 This page points me to pyo3-async-runtimes, not pyo3-asyncio. Did you perhaps look at an older version of the page?

cpu avatar Jun 15 '25 17:06 cpu

My bad. Thanks!

rjzak avatar Jun 17 '25 15:06 rjzak