Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`distutils` is deprecated and removed in Python 3.12

Open
#1,659 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
devtools

Research direction

Start with setup.py and inspect the listed distutils references under src/debugpy/_vendored/pydevd, including its setup and build files and the version/inputhook modules. Check the affected paths under Python 3.12 and determine which references are active runtime or build dependencies. Done means the relevant distutils uses no longer block supported setup or execution paths.

Written by the indexing model from the issue text.

Description

needs repro

setup.py currently falls back to distutils if versioneer does not provide the required "build" command:
https://github.com/microsoft/debugpy/blob/fb6158a059bcc6a0391eb0f670d5885d664c102d/setup.py#L62-L65
But distutils no longer exists in Python 3.12, so this code needs to be updated: either versioneer always provides this, in which case the try/except is unnecessary, or it doesn't, in which case the distutils call needs to be replaced.

There are also calls to distutils in several places in the vendored pydevd, some of which may be important to fix; an rgrep gives these occurrences:

src/debugpy/_vendored/pydevd/setup.py:from distutils.extension import Extension
src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.c:    "distutils": {
src/debugpy/_vendored/pydevd/pydev_ipython/inputhook.py:        from distutils.version import LooseVersion as V
src/debugpy/_vendored/pydevd/pydev_ipython/version.py:from distutils.version import LooseVersion
src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.c:    "distutils": {
src/debugpy/_vendored/pydevd/setup_pydevd_cython.py:        from distutils.extension import Extension
src/debugpy/_vendored/pydevd/build_tools/build.py:                    from distutils import msvc9compiler
Dominant language
Python
Stars
2.5k
Forks
202
Avg merge
5d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/debugpy

All issues in microsoft/debugpy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.