← Back to issue list

snapcraft clean snapcraft fails as it cannot find python

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1778716
Type
issue
State
closed
Author
~sergiusens
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

No scores available.

Issue body

Building snapcraft with current master or the latest edge (13881c35fa806ff9fe029205737a49393fd48a38) one cannot clean snapcraft with snapcraft due to python3 missing after init. I suspect this is an ordering issue triggering the failure (as it could have failed before too): Consider that the project was fully primed, so python3 could have been found at one point. ``` $ snapcraft --debug clean snapcraft Starting snapcraft 2.42.1+git26.4602d03 from /snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/cli. Setting up part 'snapcraft' with plugin 'python' and properties {'stage': [], 'prime': [], 'override-build': 'snapcraftctl build\nTRIPLET_PATH="$SNAPCRAFT_PART_INSTALL/usr/lib/$(gcc -print-multiarch)"\nLIBSODIUM=$(readlink -n $TRIPLET_PATH/libsodium.so.18)\nln -s $LIBSODIUM $TRIPLET_PATH/libsodium.so\npatch -d $SNAPCRAFT_PART_INSTALL/lib/python3.5/site-packages -p1 < /home/sergiusens/source/snapcraft/stage/pyyaml-support-high-codepoints.diff\npatch $SNAPCRAFT_PART_INSTALL/usr/lib/python3.5/ctypes/__init__.py /home/sergiusens/source/snapcraft/stage/ctypes_init.diff\n', 'source': '.', 'build-packages': ['build-essential', 'libapt-pkg-dev', 'libffi-dev', 'libssl-dev', 'libsodium-dev', 'liblzma-dev', 'patch', 'sed'], 'requirements': 'requirements.txt', 'override-prime': "snapcraftctl prime\n# Now that everything is built, let's disable user site-packages\n# as stated in PEP-0370\nsed -i usr/lib/python3.5/site.py -e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/'\n# This is the last step, let's now compile all our pyc files.\n./usr/bin/python3 -m compileall .\n", 'stage-packages': ['apt', 'apt-utils', 'binutils', 'execstack', 'gpgv', 'libffi6', 'libsodium18', 'patchelf', 'squashfs-tools', 'xdelta3'], 'plugin': 'python'}. Setting up part 'patches' with plugin 'dump' and properties {'prime': ['-*.diff'], 'stage': [], 'source': 'patches', 'plugin': 'dump'}. Setting up part 'bash-completion' with plugin 'dump' and properties {'prime': [], 'stage': ['snapcraft-completion'], 'source': 'debian', 'plugin': 'dump'}. Cleaning pull step (and all subsequent steps) for snapcraft Traceback (most recent call last): File "/snap/snapcraft/1674/bin/snapcraft", line 11, in <module> load_entry_point('snapcraft==2.42.1', 'console_scripts', 'snapcraft')() File "/snap/snapcraft/1674/lib/python3.5/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/snap/snapcraft/1674/lib/python3.5/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/snap/snapcraft/1674/lib/python3.5/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/snap/snapcraft/1674/lib/python3.5/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/snap/snapcraft/1674/lib/python3.5/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 198, in clean lifecycle.clean(project, parts, step) File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_clean.py", line 205, in clean _clean_parts(parts, step, config, staged_state, primed_state) File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_clean.py", line 63, in _clean_parts part_name, step, config, staged_state, primed_state) File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_clean.py", line 36, in _clean_part config.parts.clean_part(part_name, staged_state, primed_state, step) File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/internal/project_loader/_parts_config.py", line 181, in clean_part part.clean(staged_state, primed_state, step) File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 735, in clean project_staged_state, project_primed_state, step) File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 773, in _clean_steps self.clean_pull() File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 397, in clean_pull self.plugin.clean_pull() File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/plugins/python.py", line 218, in clean_pull self._pip.clean_packages() File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/plugins/python.py", line 187, in _pip stage_dir=self.project.stage_dir) File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/plugins/_python/_pip.py", line 133, in __init__ install_dir=self._install_dir) File "/snap/snapcraft/1674/lib/python3.5/site-packages/snapcraft/plugins/_python/_python_finder.py", line 51, in get_python_command python_command_name, [stage_dir, install_dir]) snapcraft.plugins._python.errors.MissingPythonCommandError: Unable to find python3, searched: /home/sergiusens/source/snapcraft/stage:/home/sergiusens/source/snapcraft/parts/snapcraft/install ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b 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.
qwen/qwen3.6-35b-a3b Abandoned. The report detailed snapcraft clean failing with a MissingPythonCommandError during Python plugin cleanup due to an ordering problem.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1499429 snapcraft dies with "export: python3.5/dist-packages: bad variable name" snapcraft (launchpad) closed Closed without resolution due to inactivity. Snapcraft crashes when py3versions returns multiple Python versions, generating a malformed PYTHONPATH that breaks the export command.
77%
#1862163 snapcraft breaks with python app snapcraft (launchpad) closed Closed without resolution. Snapcraft auto-generated invalid command paths starting with `/` for Python apps, causing snapd validation failures. No fix, discussion, or follow-up was provided.
76%
#1531570 Can't have two python3 parts using setuptools snapcraft (launchpad) closed Closed without resolution or comments. The build conflict report was likely abandoned or superseded by upstream changes to snapcraft and Python packaging standards over the past decade.
76%
#1794443 Python parts can't be automatically rebuilt if dirty snapcraft (launchpad) closed Closed without comments or documented resolution. The snapcraft build caching bug preventing dirty Python parts from rebuilding due to missing python3 paths was abandoned.
75%
#1499424 snapcraft throws FileExistsError: with very simple Python snap snapcraft (launchpad) closed Closed without comments or explicit resolution. The FileExistsError during snapcraft stage was likely resolved in a subsequent snapcraft release or abandoned due to inactivity.
75%
#1602379 'snapcraft' and 'snapcraft-parser' need to use '#!/usr/bin/env python3' in the shebang line snapcraft (launchpad) closed Issue requesting '#!/usr/bin/env python3' shebang lines for 'snapcraft' and 'snapcraft-parser' was closed without comments or resolution details.
74%
#1615060 snapcraft clean is incomplete snapcraft (launchpad) closed Reporting that snapcraft clean skips local .snap files was closed without comments or resolution, indicating the report was abandoned or left unresolved.
74%
#1486680 snapcraft plugin for python2/3 should fix incorrect shebang on pkg_resources-generated scripts snapcraft (launchpad) closed Closed without resolution. The request to patch pkg_resources-generated shebangs from /usr/bin/python3 to /usr/bin/env python3 in the snapcraft plugin was abandoned.
73%
#1703344 snapcraft cleanbuild exits with a traceback when lxd is not installed snapcraft (launchpad) closed Closed without resolution. Missing LXD caused a FileNotFoundError during snapcraft cleanbuild. No comments, fixes, or status updates were provided.
73%
#1507357 Fail to build snap python3 distutils project snapcraft (launchpad) closed Closed without resolution. The snap build failure for Python3 distutils projects, caused by a missing usr/bin/python3 path, appears abandoned due to zero comments and extended inactivity.
73%