Skip to content

Retire distutils from Python code #3389

@fhechtAdobe

Description

@fhechtAdobe

Description of Issue

The distutils module is considered deprecated and has been removed in Python 3.12. That means the OpenUSD code (v24.11) compiles against Python 3.12, but then hits a runtime error when launching usdview.

I understand that the VFX platform for CY2025 is still targeting Python 3.11.x, but this was fixed for the build script (even though this ticket about the issue was closed: #2817) and there are only two functions from distutils still in use:

from distutils.spawn import find_executable which is easily replaceable with shutil.which. And distutils.util.strtobool, which does not have a direct replacement, but should be easy. See also https://peps.python.org/pep-0632/

It would be nice to improve the Python 3.12 support by taking this small extra step. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildBuild-related issue/PRgood first issueIndicates a good issue for first-time contributorshelp wantedIndicates an issue where help and/or a pull request from the community would be very welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions