Skip to content

Exodus fails to work on Python >=3.12 because of distutils deprecation #79

@coandco

Description

@coandco

When exodus is installed on Python 3.12 or greater, it fails with the message:

Traceback (most recent call last):
  File "/usr/local/bin/exodus", line 5, in <module>
    from exodus_bundler.cli import main
  File "/usr/local/lib/python3.13/site-packages/exodus_bundler/cli.py", line 7, in <module>
    from exodus_bundler.bundling import create_bundle
  File "/usr/local/lib/python3.13/site-packages/exodus_bundler/bundling.py", line 19, in <module>
    from exodus_bundler.dependency_detection import detect_dependencies
  File "/usr/local/lib/python3.13/site-packages/exodus_bundler/dependency_detection.py", line 6, in <mod
ule>
    from exodus_bundler.launchers import find_executable
  File "/usr/local/lib/python3.13/site-packages/exodus_bundler/launchers.py", line 7, in <module>
    from distutils.spawn import find_executable as find_executable_original
ModuleNotFoundError: No module named 'distutils'

This is due to distutils being removed. Luckily, the migration guide points out that distutils.spawn.find_executable can be directly replaced with shutils.which, so it's a one-line fix.

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