[4.0.4][strict] usage of the python plugin forces the python3 interpreter to be shipped in the snap
Metadata
Current evaluation
⚠️ This summary may be outdated — the issue content or evaluation prompts have changed since this evaluation was made.
Closed without resolution. The python plugin forces python3 into the snap, causing runtime path conflicts. Likely abandoned or superseded by newer snapcraft plugin versions.
Suggested action: —
No scores available.
Issue body
The python plugin uses the following command to set up a venv in the installation directory:
https://github.com/snapcore/snapcraft/blob/4.0.4/snapcraft/plugins/v2/python.py#L117-L120
${SNAPCRAFT_PYTHON_INTERPRETER}" -m venv ${SNAPCRAFT_PYTHON_VENV_ARGS} "${SNAPCRAFT_PART_INSTALL}
This forces python3 to be copied into the snap without any explicit configuration:
snapcraft-microstack # stat parts/openstack-projects/install/bin/python3
File: parts/openstack-projects/install/bin/python3 -> /root/stage/bin/python3
Size: 23 Blocks: 0 IO Block: 4096 symbolic link
Device: 10fc80h/1113216d Inode: 7210747 Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2020-06-10 17:27:10.515782934 +0000
Modify: 2020-06-10 17:27:10.511782914 +0000
Change: 2020-06-10 17:27:10.511782914 +0000
Birth: -
snapcraft-microstack # rm parts/openstack-projects/install/bin/python3
snapcraft-microstack # "${SNAPCRAFT_PYTHON_INTERPRETER}" -m venv ${SNAPCRAFT_PYTHON_VENV_ARGS} "${SNAPCRAFT_PART_INSTALL}"
snapcraft-microstack # stat parts/openstack-projects/install/bin/python3
File: parts/openstack-projects/install/bin/python3 -> /root/stage/bin/python3
Size: 23 Blocks: 0 IO Block: 4096 symbolic link
Device: 10fc80h/1113216d Inode: 7210747 Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2020-06-10 17:27:28.487873571 +0000
Modify: 2020-06-10 17:27:28.483873551 +0000
Change: 2020-06-10 17:27:28.483873551 +0000
Birth: -
Meanwhile, I would like to avoid this and the one shipped with core20.
And at runtime the lack of that leads to subtle failures like this:
# a shell in the snap environment:
# sha256sum /usr/bin/python3.8
3fe2b9781ccb82b2a143cdcac2630ff25a74e049d5f34d6c10edd0598ccb705f /usr/bin/python3.8
# sha256sum /snap/microstack/x11/bin/python3
3fe2b9781ccb82b2a143cdcac2630ff25a74e049d5f34d6c10edd0598ccb705f /snap/microstack/x11/bin/python3
# python3.8
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keystone
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'keystone'
>>> import sys
>>> sys.path
['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/lib/python3/dist-packages']
# python3
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keystone
>>> import sys
>>> sys.path
['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/snap/microstack/x11/lib/python3.8/site-packages']
# outside the confined environment:
$ sha256sum /snap/core20/current/usr/bin/python3
3fe2b9781ccb82b2a143cdcac2630ff25a74e049d5f34d6c10edd0598ccb705f /snap/core20/current/usr/bin/python3
$ sha256sum /snap/core20/current/bin/python3
3fe2b9781ccb82b2a143cdcac2630ff25a74e049d5f34d6c10edd0598ccb705f /snap/core20/current/bin/python3
$ sha256sum /snap/microstack/current/bin/python3
05d75e4d16006f760b67b0901587f0f94dace6b7231e1351c1349ecbb0ebaf4c /snap/microstack/current/bin/python3
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The python plugin forces python3 into the snap, causing runtime path conflicts. Likely abandoned or superseded by newer snapcraft plugin versions. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution due to inactivity. The python plugin forced python3 inclusion, causing strict confinement and runtime path conflicts. No fix or workaround was implemented, and the report was abandoned. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The Python plugin forces the python3 interpreter into snaps, causing runtime import failures. With zero comments and no follow-up, the issue was abandoned. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution or comments. The python plugin forcing automatic python3 interpreter inclusion was likely abandoned or superseded by newer snapcraft versions and core20 base updates. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1850921 Python plugin: file conflicts when using the plugin with a custom version of Python from another part | snapcraft (launchpad) | open | Snapcraft 2.44 Python plugin bundles default Python 3.5 when a custom Python 3.7 is built in another part, causing file conflicts. Root cause: stage_packages evaluated too early. No maintainer response; predates Snapcraft 3.x which uses craft-parts venv-based Python plugin without stage_packages. | |
| #1778716 snapcraft clean snapcraft fails as it cannot find python | snapcraft (launchpad) | closed | Closed without comments or explicit resolution, likely abandoned or resolved in a later release. The bug reported a MissingPythonCommandError during snapcraft clean due to python3 path resolution ordering. | |
| #1604451 python3 plugin results in large snap - unnecessary baggage? | snapcraft (launchpad) | closed | Abandoned and closed without resolution. No fix or configuration change addressed the oversized snap generated by the python3 plugin. | |
| #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. | |
| #1880319 Python plugin --classic snap conflicts with system python | snapcraft (launchpad) | closed | Closed without comments or resolution, likely abandoned. The issue reported a Python plugin conflict where classic confinement snaps incorrectly imported host system libraries instead of packaged dependencies. |