Install & Compatibility
Where this runs
tested against v3.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.464s · 53.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.5s · import 1.356s · 54MB
49MB installed
● package 49MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
LXDInstance
✓ from craft_providers.lxd import LXDInstance
Correct import for LXD provider instance.
MultipassInstance
✓ from craft_providers.multipass import MultipassInstance
Correct import for Multipass provider instance.
DockerInstance
✓ from craft_providers.docker import DockerInstance
✗ from craft_providers.docker import Docker
The class is named DockerInstance, not Docker.
Creates an LXD container with Ubuntu Jammy, runs a command, then deletes it.
from craft_providers.lxd import LXDInstance
from craft_providers import bases
instance = LXDInstance(name="my-instance")
instance.create(
base=bases.BuilddBase(series="jammy")
)
with instance as ctx:
print(ctx.execute_run(["lsb_release", "-a"]))
instance.delete()
Errors
Common errors & fixes
ImportError: cannot import name 'LXDInstance' from 'craft_providers'
The LXDInstance class is not directly under craft_providers; it is in craft_providers.lxd.
fixUse: from craft_providers.lxd import LXDInstance
craft_providers.errors.ProviderError: Failed to launch LXD container
LXD is not installed, not running, or the user lacks permissions.
fixEnsure LXD is installed, the daemon is running, and user is in the lxd group.
Upgrade
Version history
3.6.0latest on PyPI · released Apr 30, 2026
Audit
Dependencies
No dependency data recorded yet.