KeyError:在 Python 3.13 上安装 openai-whisper 时出现“__version__”

问题描述 投票:0回答:1

当我尝试下载 Whisper 时出现此错误 Python 版本 3.13 - 我浪费了很多时间来解决这个问题 - 有人可以帮忙吗?我什至尝试恢复到较低版本但没有帮助。

Collecting openai-whisper
  Using cached openai-whisper-20240930.tar.gz (800 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
  ╰─> [25 lines of output]
      <string>:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      Traceback (most recent call last):
        File "/Users/pinjalim/Dropbox/Projects/Transcripto/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "/Users/pinjalim/Dropbox/Projects/Transcripto/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/pinjalim/Dropbox/Projects/Transcripto/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/q5/r66rvlp92fn06jqmhpg3zbwm0000gn/T/pip-build-env-jhoypdd0/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/q5/r66rvlp92fn06jqmhpg3zbwm0000gn/T/pip-build-env-jhoypdd0/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 303, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/q5/r66rvlp92fn06jqmhpg3zbwm0000gn/T/pip-build-env-jhoypdd0/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 521, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/q5/r66rvlp92fn06jqmhpg3zbwm0000gn/T/pip-build-env-jhoypdd0/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 319, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 21, in <module>
        File "<string>", line 11, in read_version
      KeyError: '__version__'
      [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.
python-3.x openai-whisper
1个回答
0
投票

这个问题所涉及的具体错误已由尚未合并的 PR openai/whisper#2409修复。

但是,截至该 PR 提交之日,

numba
也不支持 Python 3.13 ;因为 Whisper 依赖于 numba,这意味着即使纠正了
setup.py
/
version.py
问题,仍然无法在 Python 3.13 中使用 Whisper。

截至目前,numba 对 Python 3.13 的支持已于三天前合并到 numba main 中;但是,numba 的最新 release 是从 6 月中旬开始的,并且不包含此修复。

因此,截至今天,whisper 不能在 Python 3.13 上使用,仅使用其依赖链的已发布、受支持版本。

© www.soinside.com 2019 - 2024. All rights reserved.