Skip to content

ModuleNotFoundError: No module named 'distutils'

Description:

Get the following traceback when calling thefuck:

Traceback (most recent call last):
  File "/usr/bin/thefuck", line 5, in <module>
    from thefuck.entrypoints.main import main
  File "/usr/lib/python3.12/site-packages/thefuck/entrypoints/main.py", line 2, in <module>
    from ..system import init_output
  File "/usr/lib/python3.12/site-packages/thefuck/system/__init__.py", line 7, in <module>
    from .unix import *  # noqa: F401,F403
    ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/thefuck/system/unix.py", line 6, in <module>
    from distutils.spawn import find_executable
ModuleNotFoundError: No module named 'distutils'

Additional info:

  • package version(s):3.32-8
  • config and/or log files:
  • link to upstream bug report, if any:

Steps to reproduce:

  1. install thefuck
  2. enter fuck in the terminal

Solution

distutils package is removed in python version 3.12. https://stackoverflow.com/a/76691103

After installing python-setuptools, the issue is gone.

Maybe we should add it to dependencies.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information