Registry / other / pyo3
library0.29.0rscratesunverified

Bindings to Python interpreter, enabling Rust code to call Python and vice versa.

# Cargo.toml [dependencies] pyo3 = "0.29.0"
INSTALL
IMPORT
SIG · PYO3
P
pyo3
otherrustv0.29.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Python
✓ use pyo3::prelude::*;

Minimal example showing how to acquire the Python GIL and run Python code.

use pyo3::prelude::*; fn main() -> PyResult<()> { Python::with_gil(|py| { let sys = py.import("sys")?; let version: String = sys.getattr("version")?.extract()?; println!("Python version: {}", version); Ok(()) }) }
Debug
Known issues
gotchaRequires a compatible Python installation and the correct Python interpreter to be linked.
fix
Ensure Python development headers are installed (e.g., `python3-dev` on Debian) and set the `PYO3_PYTHON` environment variable if needed.
affects: >=0.0.0
Upgrade
Version history
0.29.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources