8

I wanted to check out OpenAI whisper and see if I could find some personal applications for it. I went on github and followed the instructions to set it up. My primary system is on Windows 11 and I get this error; "FileNotFoundError: [WinError 2] The system cannot find the file specified" when trying to run the test script on my system.

Things I did to troubleshoot:

  • Disabled MS defender and all antivirus.
  • Moved the script and audio file to the same directory.
  • Moved the script and audio file to various directories.
  • Ran VSCODE with admin privileges.
  • Tried the "command-line usage".
  • Tried everything above on a second system that run windows 10.
  • The script ran on a third system with Ubuntu installed.

I think this might be a permission issue from windows but I can't seem to resolve it, any suggestion will be greatly appreciated. I would prefer not to use the linux system because it lacks a dGPU.

Gordon Freeman
  • 133
  • 1
  • 1
  • 5

6 Answers6

7

I initially ran into this same problem and it was entirely related to installing ffmpeg. You need to install it as a python module (with pip install ffmpeg) and from here (https://ffmpeg.org/download.html) while following these instructions: https://www.geeksforgeeks.org/how-to-install-ffmpeg-on-windows/

  • 2
    Of note: This mostly worked for me, but I had to install ffmpeg-python, not ffmpeg, or else I ran into the 'ffmpeg' has no attribute 'input'"" error at https://github.com/kkroening/ffmpeg-python/issues/174. To fix I had to uninstall ffmpeg and ffmpeg-python both first, and then install ffmpeg-python. – T. Shaffner Mar 09 '23 at 20:38
5

I solved this by installing ffmpeg and adding the ffmpeg binary to my PATH environment variable. I was using the cmd.exe terminal not Code.

Edit: Tested in VS Code and it worked there too after including ffmpeg binary in PATH.

Fensox
  • 53
  • 4
  • I installed ffmpeg via pip and added the file path to my PATH environment, no success. – Gordon Freeman Sep 27 '22 at 03:43
  • Have you tested the command line tool with no success too? I.e. whisper test.wav – Fensox Sep 28 '22 at 09:41
  • For me, it still didn't work after the pip install of ffmpeg. But after I installed it with homebrew (`brew install ffmpeg`) it worked. I guess for Ubuntu it would be `apt install ffmpeg`. – nim.py Dec 16 '22 at 10:49
1

As mentioned by others, the key is to install ffmpeg.exe and have it accessible via command prompt. So, the solution should be:

  1. Install ffmpeg.exe (executable version, not source) to local directory (anywhere)
  2. Add ffmpeg folder path to PATH environment variable
  3. Open a Command Prompt and test if cmd: "ffmpeg -version" finds it or not. If not working, step #2 is still not correct and will run into "File not found" error when running whisper related code.

There are a few ways to add path to env %PATH%, but if you prefer manual GUI way, just right-click on Start Menu, open "System" and search for "environment variables".

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Blue Robin Mar 02 '23 at 15:08
1

It is happening due to the ffmpeg not working correctly or failed to load. Try running

ffmpeg -version

It should display something like this:- enter image description here

If you get this, it means your ffmpeg is working fine. If you are not getting these details then try installing using below command. Hopefully it should work.

conda install -c conda-forge ffmpeg

After installing via conda it works for me: enter image description here

Vaibhav K
  • 2,762
  • 3
  • 21
  • 22
1

I had the same problem, then I solved like this:

  • Open powershell in administration mode
  • ran choco install ffmpeg command

When you run in admin mode, then it automatically updates the PATH variable and everything worked fine afterwards

Junaed
  • 1,457
  • 13
  • 15
0

As mentioned by David Gordon, the problem lies with the absence of ffmpeg on your system.

You can install it on windows using one of these instructions as given in Whisper's github README.md file. One way is installing it using Chocolatey (https://chocolatey.org/):

from cmd or Powershell try: choco install ffmpeg