Comment 0 for bug 2061929

Revision history for this message
A. Karl Kornel (akkornel) wrote : Python docker page does not import: No module named 'distutils'

This is on a fresh install of the 20.04 beta that was released on April 12. I used the Desktop installer, into a VMware Fusion VM, on amd64.

Other than the defaults for a fresh Ubuntu Desktop install, all I ran was `apt install -y docker.io python3-docker`.

I ran `python3`, tried to execute `import docker`, and got this:

Python 3.12.3 (main, Apr 10 2024, 05:33:47) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/docker/__init__.py", line 2, in <module>
    from .api import APIClient
  File "/usr/lib/python3/dist-packages/docker/api/__init__.py", line 2, in <module>
    from .client import APIClient
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 10, in <module>
    from .. import auth
  File "/usr/lib/python3/dist-packages/docker/auth.py", line 5, in <module>
    from . import credentials
  File "/usr/lib/python3/dist-packages/docker/credentials/__init__.py", line 2, in <module>
    from .store import Store
  File "/usr/lib/python3/dist-packages/docker/credentials/store.py", line 7, in <module>
    from .utils import create_environment_dict
  File "/usr/lib/python3/dist-packages/docker/credentials/utils.py", line 1, in <module>
    import distutils.spawn
ModuleNotFoundError: No module named 'distutils'

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: python3-docker 5.0.3-1ubuntu1
ProcVersionSignature: Ubuntu 6.8.0-22.22-generic 6.8.1
Uname: Linux 6.8.0-22-generic x86_64
ApportVersion: 2.28.0-0ubuntu1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Tue Apr 16 16:35:20 2024
InstallationDate: Installed on 2024-04-16 (0 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Beta amd64 (20240410.2)
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: python-docker
UpgradeStatus: No upgrade log present (probably fresh install)