Skip to content

AttributeError: module 'distutils._msvccompiler' has no attribute '_get_vc_env' #4874

@ghost

Description

setuptools version

setuptools>75.8.2

Python version

Python 3.12

OS

Windows

Additional environment information

No response

Description

After version >75.8.2 , following example code is having an issue:

Error:

AttributeError: module 'distutils._msvccompiler' has no attribute '_get_vc_env'

Example code:

from setuptools._distutils import _msvccompiler
result = _msvccompiler._get_vc_env('x64')
print(result)

Expected behavior

Example code:

from setuptools._distutils import _msvccompiler
result = _msvccompiler._get_vc_env('x64')
print(result)

It is working without problem with 75.8.2 or earlier.

pip install setuptools<=75.8.2

output:

returns environment variables


On March 9, new version of setuptools is published and after this updat it started to give error:

Error:

AttributeError: module 'distutils._msvccompiler' has no attribute '_get_vc_env'

How to Reproduce

from setuptools._distutils import _msvccompiler
result = _msvccompiler._get_vc_env('x64')
print(result)

Run this with setuptools<=75.8.2 and setuptools>75.8.2

Output

    result = _msvccompiler._get_vc_env('x64')
             ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'distutils._msvccompiler' has no attribute '_get_vc_env'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions