跳至主要內容
安装Nuitka时遇到pip subprocess to install build dependencies did not run successfully

背景

使用MSYS2自带的Python3.11.8创建的虚拟环境下安装Nuitka会报如下错误

  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [51 lines of output]
      Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
      Collecting cffi==1.16.0
        Using cached https://pypi.tuna.tsinghua.edu.cn/packages/68/ce/95b0bae7968c65473e1298efb042e10cafc7bafc14d9e4f154008241c91d/cffi-1.16.0.tar.gz (512 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status '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:\Users\BlueCitizen\AppData\Local\Temp\pip-build-env-r75amcq2\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')
        [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: subprocess-exited-with-error

      Getting requirements to build wheel did not run successfully.
      exit code: 1

      See above for output.

      note: This error originates from a subprocess, and is likely not a problem with pip.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

BlueCitizen...大约 2 分钟开发NuitkaPython