You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows11下Unity嵌入Python安装Aubio失败求助

问题:Unity嵌入Python环境下安装aubio失败

我在Unity中尝试嵌入Python并安装aubio(遵循Reddit上的《在Unity中嵌入Python》教程),使用的是python.org提供的Python 3.8.0 amd64嵌入版。按照指导在CMD中执行命令:

.\Scripts\pip.exe install aubio

遭遇以下错误:

Collecting aubio
  Using cached aubio-0.4.9.tar.gz (479 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\tonno\AppData\Local\Temp\pip-install-nae__h7q\aubio_d64e5b80e34e4946baa180420af258fd\setup.py", line 10, in <module>
          from moresetuptools import build_ext, CleanGenerated
        File "python\lib\moresetuptools.py", line 7, in <module>
          from this_version import get_aubio_version
      ModuleNotFoundError: No module named 'this_version'
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
解决方案

这个错误源于aubio 0.4.9的源码包缺失this_version.py文件,导致安装时无法生成元数据。可以通过以下方法解决:

  • 安装预编译wheel包:
    针对Python 3.8 Windows 64位环境,直接强制安装预编译包:

    .\Scripts\pip.exe install aubio==0.4.9 --only-binary :all:
    

    如果命令无法找到对应包,可手动下载aubio-0.4.9-cp38-cp38-win_amd64.whl文件,再执行本地安装:

    .\Scripts\pip.exe install 你下载的wheel文件路径
    
  • 升级Python版本:
    aubio对Python 3.9及以上版本的预编译支持更完善,更换为对应版本的嵌入版Python后,直接执行原安装命令即可:

    .\Scripts\pip.exe install aubio
    
  • 手动修复源码包(不推荐):
    若必须使用当前环境,需下载aubio完整源码包,确保python目录下存在this_version.py文件,再执行本地源码安装:

    .\Scripts\pip.exe install 你下载的源码包路径
    

内容的提问来源于stack exchange,提问作者Satin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 18:40:22