Skip to content

Install problem - ModuleNotFoundError: No module named 'distutils' #1

@kenwebb

Description

@kenwebb

I am using Ubuntu 24.04.2 LTS on a desktop computer.
Running "python3 --version" in a terminal window results in: Python 3.12.3

I am using Thonny 4.0.1 to run a simple https://github.com/pimoroni/qwstpad-micropython example, where I have "from qwstpad import QwSTPad". My device is a new Pico 2 w from Pimoroni.

In Thonny I selected Tools > Manage packages...
and did "Search on PyPI" for "qwstpad-micropython".

Thonny found "No results." and suggested "Try opening the package directly: qwstpad-micropython". I clicked on the name and got:
qwstpad-micropython
Latest stable version: 0.0.1
Summary: Micropython library for the Pimoroni QwSTPad
Author: Could not find the package info from PyPI. Error code: ...

I went ahead and clicked "Install". It popped up a window that displayed "Installing 'qwstpad-micropython' Error

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/__main__.py", line 29, in <module>
    from pip._internal.cli.main import main as _main
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/cli/main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
    from pip._internal.cli.parser import ConfigOptionParser
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/cli/parser.py", line 12, in <module>
    from pip._internal.configuration import Configuration, ConfigurationError
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/configuration.py", line 26, in <module>
    from pip._internal.utils.logging import getLogger
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/utils/logging.py", line 27, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/utils/misc.py", line 39, in <module>
    from pip._internal.locations import get_major_minor_version
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/locations/__init__.py", line 14, in <module>
    from . import _distutils, _sysconfig
  File "/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/lib/python3.12/site-packages/pip/_internal/locations/_distutils.py", line 9, in <module>
    from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils'
Error Command '['/home/ken/.cache/pipkin/workspaces/10a20aff63511e905766381f44b29d23/bin/python3', '-I', '-m', 'pip', '--no-color', '--disable-pip-version-check', '--trusted-host', '127.0.0.1', 'install', '--no-compile', '--use-pep517', '--upgrade-strategy', 'only-if-needed', 'qwstpad-micropython', '--index-url', 'http://127.0.0.1:36628']' returned non-zero exit status 1.

Note the error: ModuleNotFoundError: No module named 'distutils'
A web search for this error tells me that 'distutils' was deprecated in 3.10 and removed from Python3 with version 3.12, the version I use.

I am not a Python expert. Please advise what I should do to get my qwstpad-micropython program working. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions