← Back to issue list

“ModuleNotFoundError: No module named ‘distutils.util’” when trying to build snaps on Launchpad (but works locally)

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1864589
Type
issue
State
open
Author
~pieq
Labels
Created
Updated
Closed

Current evaluation

Snapcraft Launchpad builds fail with 'No module named distutils.util' due to stage-directory caching of python3 deps; workaround (add python3-distutils to stage-packages) documented in body. Untriaged, no comments, inactive ~5 years.

Suggested action: close stale

Reason: The issue is ~6.5 years old with zero comments, no labels, and no maintainer engagement, and the specific failure mode depends on the python3-distutils package, which was removed from Python 3.12 (PEP 632) and modern Ubuntu bases, so the original error is no longer reproducible on supported versions. The body already documents a working workaround (adding python3-distutils to stage-packages), and the old parts/staging system involved has since been rewritten. Confidence is moderate because code inspection was unavailable (no pinned SHA) to confirm whether the underlying stage-caching behavior was independently fixed.

Impact: 30 Quick Win: 13.5 Staleness: 92 Complexity: 55 Confidence: 65 Support Request: 10

Issue body

This initially started as a discussion on the forum, so the whole gist of the problem is explained there: https://forum.snapcraft.io/t/modulenotfounderror-no-module-named-distutils-util-when-trying-to-build-snaps-on-launchpad-but-works-locally/15434 In a nutshell: - A snapcraft recipe can be build locally on my laptop, but fails to build on Launchpad build infrastructure due to "No module named 'distutils.util'" error. - The problem seems to be that there are some parts built before the part where it fails, pulling some python3 dependencies (but not python3-distutils) that are cached in the stage directory - When the main part is built, snapcraft tries to used cached data instead of pulling fresh one, resulting in a missing dependency Workaround In my case, cjp256 suggested to add `python3-distutils` to sosreport part `stage-packages`.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 30
Quick Win: 13.5
Staleness: 92
Complexity: 55
Confidence: 65
Support Request: 10
close stale Snapcraft Launchpad builds fail with 'No module named distutils.util' due to stage-directory caching of python3 deps; workaround (add python3-distutils to stage-packages) documented in body. Untriaged, no comments, inactive ~5 years.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 30
close stale Launchpad snap builds fail with missing distutils.util module. Workaround provided. Untriaged and inactive for over 6 years.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 15
Confidence: 90
Support Request: 20
close stale Build failure on Launchpad due to missing distutils.util module when building snaps. Provides a workaround to add python3-distutils to stage-packages. No maintainer response or labels after over 5 years of inactivity.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 15
Confidence: 90
Support Request: 70
close stale Build failure on Launchpad due to missing distutils module, caused by cached stage packages. User provided a workaround. Issue is over 6 years old with no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 10
Confidence: 95
Support Request: 30
close stale Launchpad build failure caused by missing distutils.util module. Reporter provided a workaround. No maintainer response in over six years; issue is obsolete due to Python 3.12 removing distutils.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.