Skip to content

[BUG] import setuptools raises a DeprecationWarning on Windows #3536

@kmaehashi

Description

@kmaehashi

setuptools version

setuptools==65.0.2

Python version

Python 3.9

OS

Windows

Additional environment information

No response

Description

On Windows, import setuptools raises a warning added in pypa/distutils@c802880.

This issue does not occur in setuptools 65.0.1.

Expected behavior

No warnings.

How to Reproduce

python -Werror -c "import setuptools"

Output

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\maehashi\.venv-py39\lib\site-packages\setuptools\__init__.py", line 247, in <module>
    monkey.patch_all()
  File "C:\Users\maehashi\.venv-py39\lib\site-packages\setuptools\monkey.py", line 99, in patch_all
    patch_for_msvc_specialized_compiler()
  File "C:\Users\maehashi\.venv-py39\lib\site-packages\setuptools\monkey.py", line 136, in patch_for_msvc_specialized_compiler
    msvc = import_module('setuptools.msvc')
  File "C:\Program Files\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\maehashi\.venv-py39\lib\site-packages\setuptools\msvc.py", line 61, in <module>
    from distutils.msvc9compiler import Reg
  File "C:\Users\maehashi\.venv-py39\lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 34, in <module>
    warnings.warn(
DeprecationWarning: msvc9compiler is deprecated and slated to be removed in the future. Please discontinue use or file an issue with pypa/distutils describing your use case.

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions