Python 3.13 KeyError: '__version__' when installing openai-whisper

I’m facing a challenge while trying to install the openai-whisper package on my Python 3.13 environment. Each time I attempt to execute the installation, it results in a KeyError regarding ‘version’. I’ve devoted a significant amount of time troubleshooting, including reverting to an earlier Python version, but the problem continues.

Collecting openai-whisper
  Downloaded 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
  ╰─> [22 lines of output]
      <string>:4: DeprecationWarning: pkg_resources is deprecated as an API
      Traceback (most recent call last):
        File "/home/user/myproject/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 361, in <module>
          main()
        File "/home/user/myproject/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 342, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/user/myproject/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 125, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-abc123/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-abc123/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 312, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-abc123/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 528, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-abc123/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 326, in run_setup
          exec(code, locals())
        File "<string>", line 19, in <module>
        File "<string>", line 9, in read_version
      KeyError: '__version__'
      [end of output]

Has anyone else faced this issue? What would be the most effective way to fix this version-related problem?

This happens because the package can’t find version metadata when building on Python 3.13. It’s a compatibility issue with how setuptools handles version detection on newer Python versions. I’ve hit this with several packages after upgrading to 3.13 early. Best fix is creating a fresh virtual environment with Python 3.11 or 3.12 - they work much better with audio libraries like whisper. You can also try upgrading your tools first: pip install --upgrade pip setuptools wheel. Newer versions handle metadata extraction better.

Had this exact problem last week after upgrading to 3.13. Python 3.13 changed how it handles package metadata during builds, which breaks openai-whisper. You’ve got two options: downgrade to Python 3.12 temporarily, or switch to faster-whisper instead. I’d go with faster-whisper - just run pip install faster-whisper. It’s a drop-in replacement that actually gets updated regularly and works fine with newer Python versions. Plus it’s faster. The original openai-whisper package just hasn’t caught up with 3.13’s build system changes yet.

i’ve run into that too! looks like openai-whisper isn’t compatible with python 3.13 yet. the setup.py can’t get the version. you might wanna try installing directly from github instead: pip install git+https://github.com/openai/whisper.git. should help with the newer python!

Ugh, same issue here. Python 3.13’s too new for most packages. Try pip install --use-pep517 openai-whisper - sometimes fixes metadata problems. If that doesn’t work, just use 3.12 instead. Saved me tons of headaches.

Version metadata issues are such a pain when you just want audio processing to work. Skip the Python compatibility nightmare - automate the whole whisper workflow instead.

I’ve built audio processing pipelines that dodge these dependency headaches entirely. Run whisper through automated workflows that handle environment setup for you. Consistent results, no broken Python versions.

Set up workflows that process audio files, handle different formats, and connect to storage services. No more debugging package installs or managing virtual environments. Upload audio, get transcriptions back.

Perfect when you need reliable audio processing that won’t break with every Python update. Check out https://latenode.com for automated workflows.