The `juju` library provides a Pythonic interface for interacting with Juju controllers and models, allowing programmatic control over Juju deployments. As of version 3.6.1.3, the library is not under active development and primarily receives critical bug fixes. Releases are infrequent and typically address specific issues rather than introducing new features.
pip install jujuVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to connect to a Juju model using the `juju` library and retrieve information about deployed applications. It uses `asyncio` for asynchronous operations, which is the native way to interact with `libjuju`. Ensure you have a Juju controller configured and are logged in via the `juju` CLI.
Upgrade `python-libjuju` to version 3.5.2.1 or newer, or explicitly pin `websockets<14.0,>=8.1` in your project dependencies if you must use an older `libjuju`.
Replace imports and calls to `juju.jasyncio.run` with `from juju.loop import run` or `asyncio.run`.
Upgrade to `juju` version 3.6.1.3 or newer to resolve the secret value corruption issue.
Consider migrating integration tests to the `jubilant` library as per the official recommendations.
Upgrade `python-libjuju` to 3.5.2.1 or newer. Alternatively, restrict `websockets` to version `<14.0,>=8.1` in your `requirements.txt`.
Update your import statement to `from juju.loop import run` or use `asyncio.run` directly for running async functions.
Upgrade `python-libjuju` to version 3.6.1.3 or a later release.