snapcraft `8.0.2`+ python plugin classic core22 snap ModuleNotFoundError
Metadata
Current evaluation
Closed. No code fix was merged. A workaround was identified for Snapcraft 8 dropping PATH settings in classic snaps. An internal ticket was created for tracking.
Suggested action: —
No scores available.
Issue body
### Bug Description
We maintain a private snap where we build a classic snap
This is not an issue with using snapcraft `7.5.4`. To unblock ourselves we have pinned to `7.5.4`.
### To Reproduce
Build a classic snap with core22 as a base using `plugin: python`. Try and run any of the snap apps.
### Environment
Snapcraft is being with default config and being run with `snapcraft --enable-manifest`
### snapcraft.yaml
```shell
name: REDACTED
summary: REDACTED
description: REDACTED
base: core22
grade: devel
confinement: classic
adopt-info: REDACTED
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8
parts:
REDACTED:
plugin: python
source: .
source-type: git
build-attributes:
- enable-patchelf
build-packages:
- git
- python3
- libapt-pkg-dev
- gcc
- g++
- dpkg-dev
stage-packages:
- libpython3.10-minimal
- libpython3.10-stdlib
- python3.10-minimal
- python3.10-venv
override-pull: |
craftctl default
DATE="$(date +%Y.%m.%d)"
GIT="$(git rev-parse --short HEAD)"
craftctl set version="${DATE}+git${GIT}"
apps:
REDACTED:
command: bin/REDACTED
```
### Relevant log output
```shell
from REDACTED.generate import generate_REDACTED
ModuleNotFoundError: No module named 'REDACTED'
```
### Additional context
Apologies for the `REDACTED` references but this is a private project.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed. No code fix was merged. A workaround was identified for Snapcraft 8 dropping PATH settings in classic snaps. An internal ticket was created for tracking. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without a fix. Snapcraft 8 removed the PATH variable for classic snaps, triggering ModuleNotFoundError. The issue persists; users must explicitly invoke python or pin to 7.5.4 as a workaround. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The reporter confirmed the ModuleNotFoundError persists in snapcraft 8.0.3 after mistaking a virtual environment for a fix. The bug likely stems from removing PATH variables for classic snaps in version 8. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed. No fix was merged; the issue stems from snapcraft 8 dropping the PATH variable for classic snaps. A workaround was confirmed: explicitly invoke python in the app command. The reporter verified it but could not consistently reproduce the error. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without a fix. The regression stems from snapcraft 8 dropping PATH settings for classic snaps. A workaround using explicit python paths was confirmed, but the issue remains unresolved. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5407 Unable to build Python snaps using classic confinement with core24 using snapcraft 8.8.0 (8.x/stable) | snapcraft | closed | Resolved as a configuration issue. Classic Python snaps on core24 require explicitly adding python3.12-minimal to stage-packages and adjusting the app command. The developer acknowledged documentation gaps and announced upcoming Python plugin improvements. | |
| #5408 Unable to build usable Python snaps which use Ubuntu-provided python3-* dependencies using strict confinement with core24 using snapcraft 8.8.0 (8.x/stable) | snapcraft | closed | Closed as completed. The author applied a PYTHONPATH workaround in snapcraft.yaml to access staged packages. Maintainers declined a code fix, marking the issue as a reference for a future Python plugin rewrite. | |
| #4870 snapcraft pack error obtuse on snapd errors | snapcraft | closed | Closed as a duplicate of issue #4548. The snapcraft pack error handling regression affecting core22 and core24 is superseded by the referenced tracking issue. |