IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

python

Python interoperability: import packages and modules, call functions, type conversion.

The python package enables interoperability between Mojo and Python code. It provides mechanisms for importing Python packages and modules, calling Python functions, and converting values between Mojo and Python types. This package allows Mojo programs to leverage the extensive Python ecosystem while maintaining Mojo's performance characteristics.

Use this package when you need to call Python libraries, integrate existing Python code into Mojo applications, or leverage Python's ecosystem for functionality not yet available in native Mojo.

Modules