Skip to content

cffi relies on deprecated (now removed) distutils.msvc9compiler module #117

Closed
@alex

Description

@alex

In pypa/distutils#287 this module was removed and in pypa/setuptools#4606 that was incorporated into setuptools 74.

As a result, building cffi now fails with:

    Traceback (most recent call last):
      File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bywibcpm\overlay\Lib\site-packages\cffi\_shimmed_dist_utils.py", line 33, in <module>
        from distutils.msvc9compiler import MSVCCompiler
    ModuleNotFoundError: No module named 'distutils.msvc9compiler'

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "D:\a\cryptography\cryptography\src\_cffi_src\build_openssl.py", line 60, in <module>
        ffi.emit_c_code(c_file)
      File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bywibcpm\overlay\Lib\site-packages\cffi\api.py", line 695, in emit_c_code
        recompile(self, module_name, source,
      File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bywibcpm\overlay\Lib\site-packages\cffi\recompiler.py", line 1546, in recompile
        ext = ffiplatform.get_extension(ext_c_file, module_name, **kwds)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bywibcpm\overlay\Lib\site-packages\cffi\ffiplatform.py", line 9, in get_extension
        from cffi._shimmed_dist_utils import Extension
      File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bywibcpm\overlay\Lib\site-packages\cffi\_shimmed_dist_utils.py", line 36, in <module>
        raise Exception("This CFFI feature requires setuptools on Python >= 3.12. Please install the setuptools package.") from ex
    Exception: This CFFI feature requires setuptools on Python >= 3.12. Please install the setuptools package.

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