← 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

Python plugin fails on core26 base due to missing Python interpreter; maintainers suggest implementing clearer error guidance

Suggested action: keep open

Reason: Maintainers @bepri and @jahn-junior have acknowledged the issue and explicitly suggested implementing a clearer warning message when users don't include python3-venv in stage-packages. The issue is valid, scoped, and has maintainer buy-in. No craft-parts commits address this yet (git_log_search returned no matches for 'core26 python').

Impact: 50 Quick Win: 30.0 Staleness: 25 Complexity: 40 Confidence: 75 Support Request: 20

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
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 30.0
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 85%)

    Related issue about Python snaps on core26, fixed in snapcraft PR #6089, but the craft-parts error message improvement remains unaddressed

Related issues

Issue Project State Summary Similarity
#6020 Most Python-based snaps can't build on core26 snapcraft closed Resolved in PR #6089 and released in snapcraft 8.14.3. The python plugin now correctly handles core26 builds without assuming a system interpreter. Uv and poetry plugins remain unaddressed and will be fixed in future updates.
75%
#1874920 python plugin doesn't support base "core20" snapcraft (launchpad) closed Closed as abandoned due to inactivity. Core20 support was later added to the Python plugin in subsequent snapcraft releases.
72%