Skip to content

Unable to install CFFI 1.16 on MSYS2 MINGW64 using pip (24.1) and python (3.11.9) #90

@chxmberland

Description

@chxmberland

Description

I am currently attempting to install CFFI on my Windows machine running MSYS2 MINGW64 using the terminal command pip install cffi.

System and Versions

OS: Windows 11, MSYS2 MINGW64
Python: 3.11.9
Pip: 24.1
CFFI: 1.16, 1.15.1, 1.15 (versions with which I could reproduce this error)

However, I get the following error:

Collecting cffi
  Using cached cffi-1.16.0.tar.gz (512 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      Traceback (most recent call last):
        File "C:/msys64/mingw64/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "C:/msys64/mingw64/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:/msys64/mingw64/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:/msys64/tmp/pip-build-env-hyndckce/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:/msys64/tmp/pip-build-env-hyndckce/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "C:/msys64/tmp/pip-build-env-hyndckce/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 126, in <module>
        File "<string>", line 105, in uses_msvc
        File "C:/msys64/tmp/pip-build-env-hyndckce/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/config.py", line 220, in try_compile
          self._compile(body, headers, include_dirs, lang)
        File "C:/msys64/tmp/pip-build-env-hyndckce/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/config.py", line 132, in _compile
          self.compiler.compile([src], include_dirs=include_dirs)
        File "C:/msys64/tmp/pip-build-env-hyndckce/overlay/lib/python3.11/site-packages/setuptools/_distutils/_msvccompiler.py", line 343, in compile
          self.initialize()
        File "C:/msys64/tmp/pip-build-env-hyndckce/overlay/lib/python3.11/site-packages/setuptools/_distutils/_msvccompiler.py", line 246, in initialize
          raise DistutilsPlatformError(
      distutils.errors.DistutilsPlatformError: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')

Discussion from #21 did not seem to yield similar results to those in that thread. For example, running pip install --no-build-isolation cffi does not make any difference. Additionally, I get the same error running both pip install cffi==1.15.1 and pip install cffi==1.15.

Furthermore, solutions to similar issues in this Stack Overflow thread did not seem to work either. Specifically, using SETUPTOOLS_USE_DISTUTILS=stdlib.

Any help or insights would be greatly appreciated!

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