Noble: ModuleNotFoundError: No module named 'distutils'

Bug #2063465 reported by Andreas Schildbach
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
docker-compose (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

After an upgrade of my server from Jammy to Noble, I get

```
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/docker-compose", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 9, in <module>
    from distutils.spawn import find_executable
ModuleNotFoundError: No module named 'distutils'
```

I suspect this is missing a dependency declaration?

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: docker-compose 1.29.2-6ubuntu1
ProcVersionSignature: Ubuntu 6.8.0-31.31-generic 6.8.1
Uname: Linux 6.8.0-31-generic x86_64
ApportVersion: 2.28.1-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Thu Apr 25 15:32:27 2024
PackageArchitecture: all
SourcePackage: docker-compose
UpgradeStatus: Upgraded to noble on 2024-04-25 (0 days ago)

Revision history for this message
Andreas Schildbach (schildbach) wrote :
Revision history for this message
Andreas Schildbach (schildbach) wrote (last edit ):

Not sure if this is the right package, but installing `python3-distutils-extra` seems to fix the issue, but now I'm running into a different problem (https://bugs.launchpad.net/ubuntu/+source/docker-compose/+bug/2056735) so I'm not absolutely sure.

Revision history for this message
Andreas Schildbach (schildbach) wrote :

Indeed, the Jammy package depended on `python3-distutils` but the Noble package does not. I believe this is a packaging bug.

https://packages.ubuntu.com/jammy/docker-compose
https://packages.ubuntu.com/noble/docker-compose
https://packages.ubuntu.com/noble/python3-compose

Revision history for this message
yoyoma2 (sinbad-4273) wrote :

Upgrading from Mantic Minotaur to Noble Numbat also gave me this exact error with docker-compose. So what's the clean/correct solution?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in docker-compose (Ubuntu):
status: New → Confirmed
Revision history for this message
yoyoma2 (sinbad-4273) wrote :

I'm a docker noob but installing the v2 plugin and running 'docker compose' instead of 'docker-compose' seems to work around the problem.

sudo apt-get install docker-compose-v2

Revision history for this message
yoyoma2 (sinbad-4273) wrote :

It seems that moving to the v2 plugin version of docker compose isn't a bad idea:

https://askubuntu.com/a/1508135/322753

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.