{"id":57251,"library":"pyo3","title":"PyO3","description":"Bindings to Python interpreter, enabling Rust code to call Python and vice versa.","status":"active","version":"0.29.0","language":"rust","source_language":null,"source_url":"https://github.com/pyo3/pyo3","tags":["python","ffi","interop","bindings","embedding"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\npyo3 = \"0.29.0\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add pyo3","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"Python","correct":"use pyo3::prelude::*;"}],"quickstart":{"code":"use pyo3::prelude::*;\n\nfn main() -> PyResult<()> {\n    Python::with_gil(|py| {\n        let sys = py.import(\"sys\")?;\n        let version: String = sys.getattr(\"version\")?.extract()?;\n        println!(\"Python version: {}\", version);\n        Ok(())\n    })\n}","lang":"rust","description":"Minimal example showing how to acquire the Python GIL and run Python code."},"warnings":[{"fix":"Ensure Python development headers are installed (e.g., `python3-dev` on Debian) and set the `PYO3_PYTHON` environment variable if needed.","message":"Requires a compatible Python installation and the correct Python interpreter to be linked.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'bind':2,18 'call':10 'code':8 'embed':19 'enabl':6 'ffi':16 'interop':17 'interpret':5 'pyo3':1 'python':4,11,15 'rust':7 'versa':14 'vice':13","created_at":"2026-06-16T15:35:00.098250+00:00","updated_at":"2026-06-16T15:35:00.098250+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/pyo3/pyo3","github":"https://github.com/pyo3/pyo3","docs":"https://docs.rs/pyo3/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["other"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}