“ModuleNotFoundError: No module named ‘distutils.util’” when trying to build snaps on Launchpad (but works locally)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Confirmed
|
Undecided
|
Chris Patterson |
Bug Description
This initially started as a discussion on the forum, so the whole gist of the problem is explained there:
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`.
Changed in snapcraft: | |
status: | New → Confirmed |
assignee: | nobody → Chris Patterson (cjp256) |
I can confirm the workaround provided by cjp256 works as expected for all 3 architectures I build my software against. Thank you Chris!
→ https:/ /launchpadlibra rian.net/ 466606658/ buildlog_ snap_ubuntu_ bionic_ amd64_qabro_ BUILDING. txt.gz /launchpadlibra rian.net/ 466608162/ buildlog_ snap_ubuntu_ bionic_ armhf_qabro_ BUILDING. txt.gz /launchpadlibra rian.net/ 466608336/ buildlog_ snap_ubuntu_ bionic_ arm64_qabro_ BUILDING. txt.gz
→ https:/
→ https:/