← Back to issue list

Python plugin fails on core26: base snap does not include Python interpreter

View original Github issue

Metadata

Project
craft-parts
Number
#1660
Type
issue
State
open
Author
agherzan
Labels
—
Created
Updated
Closed
—

Current evaluation

core26 lacks a Python runtime, so Python-plugin builds fail unless Python is staged. Documentation covers the workaround, and maintainers are pursuing clearer warning guidance.

Suggested action: keep open

Reason: @bepri confirmed the core26 requirement is documented and identified clearer warning guidance as the remaining work; @jahn-junior agreed and proposed linking the Python dependency documentation. BasePythonPlugin still falls back to a system interpreter and otherwise exits late with a generic message, leaving a valid but bounded diagnostics improvement open.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 25 Complexity: 30 Confidence: 92 Actionability: 80

Issue body

### Bug Description ## Summary The python plugin fails to build snaps targeting `core26` because the base snap no longer includes a Python interpreter. The plugin assumes Python will be available either in the staged payload or in the base, but core26 has removed Python from the base. ## Steps to Reproduce 1. Create a snap using the python plugin with `base: core26` 2. Run `snapcraft` ## Expected Behavior Either: - The python plugin automatically stages Python when the base doesn't include it, OR - The plugin fails early with a clear error message instructing the user to add `python3-venv` to `stage-packages` ## Actual Behavior The build fails late in the process with: Looking for a Python interpreter called "python3.14" in the payload... Python interpreter not found in payload. No suitable Python interpreter found, giving up. ## Details The `BasePythonPlugin` in `craft_parts/plugins/base.py`: 1. Declares `python3-dev` and `python3-venv` as **build-packages** 2. Creates a venv using the build environment's Python 3. Searches for Python in the payload (install_dir/stage_dir) 4. Falls back to `$(readlink -f "$(which python3)")` assuming it exists at runtime This fallback worked when bases (core22, core24) included Python, but breaks on core26 where Python was removed. $ ls /snap/core24/current/usr/bin/python* /snap/core24/current/usr/bin/python3 -> python3.12 /snap/core24/current/usr/bin/python3.12 $ ls /snap/core26/current/usr/bin/python* zsh: no matches found: /snap/core26/current/usr/bin/python* ## Ideas for a fix **Auto-stage Python when needed** - Detect when the target base lacks Python and automatically add `python3-venv` to stage-packages **Fail early with guidance** - Check for Python in the base during validation and emit a clear error: ``` Error: base 'core26' does not include Python. Add 'python3-venv' to stage-packages. ``` ## Workaround Manually add `python3-venv` to `stage-packages` in `snapcraft.yaml`. ## Environment - snapcraft 9.0.1 - craft-parts (bundled with snapcraft) - base: core26 (Ubuntu 26.04 / Resolute) ### part yaml ```shell parts: test: plugin: python source: . build-packages: - git stage-packages: - git - openssh-client python-packages: - ./[...] override-pull: | craftctl default craftctl set version="$(git describe --tags --always)" ``` ### Relevant log output ```shell :: 2026-08-10 18:24:49.949 :: + python3 -m venv /root/parts/[...]/install :: 2026-08-10 18:24:49.949 :: Error: [Errno 13] Permission denied: '/root/parts/[...]/install/bin/python3' :: 2026-08-10 18:24:49.949 Check the build output and verify the project can work with the 'python' plugin. ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 45
Quick Win: 25
Complexity: 30
Confidence: 92
Actionability: 80
keep open core26 lacks a Python runtime, so Python-plugin builds fail unless Python is staged. Documentation covers the workaround, and maintainers are pursuing clearer warning guidance.
stealth/space-bunny-alpha
Impact: 42
Quick Win: 25
Complexity: 32
Confidence: 93
Actionability: 88
keep open Python plugin needs clearer guidance on core26, where the base lacks a Python interpreter; documented workaround is staging Python, and maintainers support adding a warning.
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 30
Staleness: 25
Complexity: 40
Confidence: 75
Support Request: 20
keep open Python plugin fails on core26 base due to missing Python interpreter; maintainers suggest implementing clearer error guidance
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
Support Request: 10
needs triage Python plugin fails on core26 due to missing Python interpreter in base. Maintainers are discussing adding a clearer error message to guide users to stage python3-venv. Currently under discussion.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 40
Confidence: 90
Support Request: 20
needs triage Python plugin fails building for core26 base due to missing Python interpreter. Currently unlabelled, awaiting maintainer triage and decision on whether to auto-stage Python or improve error messaging.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 45
Confidence: 90
Support Request: 10
needs triage Python plugin fails when targeting core26 base due to missing Python interpreter. Well-structured bug report with reproduction steps and proposed fixes, awaiting maintainer triage.

Update history

Date Change
updated
updated
updated
created

Related work

  • Related To: snapcraft#6020 (confidence 96%)

    Tracks broader core26 Python-plugin build failures and records a Snapcraft-side fix for the standard plugin; it does not demonstrate that generic Craft Parts guidance was implemented.

Related issues

Issue Project State Summary Similarity
#6020 Most Python-based snaps can't build on core26 snapcraft closed Fixed by merged PR #6089 (commit 6ee41173c) and released in Snapcraft 8.14.3, enabling Python plugin builds on core26.
76%
#2161192 python plugin not working at all with snapcraft 9+ snapcraft (launchpad) open Core26 Python plugin builds and module loading were fixed; packaging Python separately is now documented as required by the base.
75%
#786 Python plugin. Python is broken in core24 classic snaps if snap is used on an older Ubuntu LTS version craft-parts open Core24 classic snaps using the Python plugin fail on older Ubuntu LTS hosts because staged Python cannot find its stdlib; Snapcraft 8.3.2's fix proved incomplete, with follow-up in snapcraft#5144.
73%
#1874920 python plugin doesn't support base "core20" snapcraft (launchpad) closed Closed without a recorded fix after years of inactivity. Snapcraft 4.0 added core20 support, but i386 had no core20 base and external-symlink lint failures remained.
72%
#6089 fix(plugins/python): fix core26 builds snapcraft merged Merged #6089 fixed #6020 by enabling the Python plugin for strictly confined core26 snaps and adding spread tests; released in Snapcraft 8.14.3.
72%
#1641 uv plugin fails on core26: dispatch script uses system Python instead of venv craft-parts open core26 has no Python in the base snap, so uv-built parts find no interpreter in the payload and fall back to the system python, leaving venv/bin/python pointing at a bare interpreter that lacks ops. Fix options undecided.
71%
#5144 error out if core24 classic python snap is created with the non-staged python binary snapcraft open Add a Python-plugin guard for classic snaps staged without the python3-minimal symlink; current post_prime only rewrites pyvenv.cfg, leaving the core24 failure mode unresolved.
70%