Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named "stable-whisper" #12

Open
danini1705 opened this issue Dec 18, 2023 · 21 comments
Open

No module named "stable-whisper" #12

danini1705 opened this issue Dec 18, 2023 · 21 comments

Comments

@danini1705
Copy link

I installed the script, but it seems that it doesn't work for me.
Auto subs light works.

Traceback (most recent call last):
File "", line 1, in
NameError: name 'i' is not defined. Did you mean: 'id'?
Traceback (most recent call last):
File "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Utility/auto-subs.py", line 1, in
import stable_whisper
ModuleNotFoundError: No module named 'stable_whisper'

I asked in the stable-whisper github but apparently they have no idea

@danini1705
Copy link
Author

I would love to have some more assistance, thanks! And happy new year!

@tmoroney
Copy link
Owner

tmoroney commented Feb 1, 2024

Not sure what the issue is here. Try using the auto-install method I added to the documentation.

@tmoroney
Copy link
Owner

tmoroney commented Feb 1, 2024

I'd recommend joining the discord if you are having issues.

@Swift12gaming
Copy link

im having the same problem

@philexh
Copy link

philexh commented Mar 19, 2024

Changing the import to just "whisper" helped me fix the problem!

@danini1705
Copy link
Author

danini1705 commented Mar 19, 2024 via email

@dextriminator
Copy link

go the auto subs using the guide
%PROGRAMDATA%\Blackmagic Design\DaVinci Resolve\Fusion\Scripts
after opening the utility open the auto subs using the edit option and remove the "import stable_whisper" part of the script.
it should start working

@AHM3Mk
Copy link

AHM3Mk commented Apr 2, 2024

well it is going to show up but stop at "name 'stable_whisper' is not defined" and won't do anything after.

@francqz31
Copy link

pip install stable-ts==1.1.1b0 should solve the problem ;)

@AHM3Mk
Copy link

AHM3Mk commented Apr 8, 2024

well...
I gave up yesterday and uninstalled everything and when I saw ur comment i tried again, but this time another error occurred 🫠
->
"Using model -> [ small.en ]
list index out of range"

@MoHAHAHA2
Copy link

open powershell type this
pip install -U stable-ts
boom fixed

@MoHAHAHA2
Copy link

idk bout your second error but this is for the first erros so reinstall everything then do that if the error you first wrote came up again

@Vq-x
Copy link

Vq-x commented Apr 15, 2024

I have found that it is due to multiple versions of python on your system. If your pip command is connected to another version of python then it is installing all of the packages else where, on my system I had both Python 3.10 and 3.12 so I uninstalled 3.10 and restarted my PC. I also reinstalled with the PowerShell command and it works.

@cptsubtxt
Copy link

If you encounter the problem in Mac OS X I did not find the solution, but one reason.
When using a debug script like that presented at the end and put it into the same directory as the auto-subs.py and run it in DaVinci Resolve with console turned on you will get a more detailed error.

Regarding Mac OS X and Apple Silicon (M1, M2 etc.) the problem is that some packages are compiled for x86 and some compiled in ARM64. In my case numpy is the problem.

You can install arch specific packages when available like so:

pip3 uninstall numpy
arch -arm64 pip3 install numpy    

Numpy still has a problem, so no solution yet.

import logging
import os
import platform
import sys
logger = logging.getLogger()
logging.basicConfig(filename='/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Utility/log.log', level=logging.DEBUG)
logger.debug(str(os.__file__))

print("Python version") 
print (sys. version) 
print("Version info.") 
print (sys. version_info)
system = platform.system()
machine = platform.machine()
print("System the interpreter is running") 
print(system)
print("Architecture the interpreter is running") 
print(machine)

import stable_whisper

@mangonerd
Copy link

mangonerd commented Apr 27, 2024

After hours of pulling my hair, I’ve found the solution!

  1. Go to the console inside DaVinci Resolve
  2. Enter import sys and then print(sys.version)
  3. Take note of the Python version that Resolve is using. We need to install stable-ts for that specific Python version. For me it was 3.10
  4. Install stable-ts in that version: python{your version number here} -m pip install stable-ts in my case it was python3.10 -m pip install stable-ts

Voilà! It should work now!

The problem is exactly what @Vq-x stated—having multiple Python versions and not being able to control which version resolve is using and where pip installs stuff by default. I’m not a programmer, so I assume there’s a more elegant solution to this mess. Maybe @tmoroney can integrate something in the script itself? ;)

Edit: That launched the script, but there were still issues. Ultimately, I decided to uninstall all versions of python installed through homebrew and reinstalled through the official installer on the website. Now the script works without any issues. However, the above solution may still work for you.

@Mustafiz04
Copy link

Hi I am also getting this error ModuleNotFoundError: No module named 'stable_whisper'
Can anyone please guide me to fix this error in MacOS?

@Miacrocosm
Copy link

Miacrocosm commented Jul 7, 2024

I was able to fix mine on WIndows after making sure DaVinci and my system were using the same Python version. After some uninstalling and installing of Python, I did: pip3 install -U stable-ts, in my PowerShell, and it worked after already doing: pip3 install -U openai-whisper

@GISBoost
Copy link
Contributor

GISBoost commented Jul 7, 2024

I encountered the same problem with no module stable-whisper and solution that worked for me was:

  1. Uninstall python completely from your PC
  2. Restart PC
  3. Install python 3.11.6
  4. Install PyTorch.
  5. Install Choco
    4.1 Install ffmpeg via choco with choco install ffmpeg
  6. Install whisper with pip install -U openai-whisper
  7. Completely uninstall DaVinci Resolve
  8. Restart PC
  9. Install DaVinci Resolve
  10. Install plugin via powershell Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/tmoroney/auto-subs/main/install-script.ps1").Content you will be prompted that basically almost everything is installed already

After this you should be good to go

@rfkhwaja
Copy link

^^ Tried this, did not work. The solution that worked for me was

pip uninstall numpy
pip install numpy==1.26.4

@chigoKawa
Copy link

On Mac, what I found to work is to ensure the packages are all installed, e.g., whisper, stable-ts, etc.

  • Run the following command on your terminal: pip show whisper

  • Copy the location .

  • Edit the auto-subs script, at the very top, add the following lines (replace the path with the location from previous step):

`import sys

sys.path.append(
"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages"
)`

One other thing is to ensure the version of NumPy is accurate. Someone already mentioned downgrading NumPy; I had to do that as well.

@IPintomCL
Copy link

On Mac, what I found to work is to ensure the packages are all installed, e.g., whisper, stable-ts, etc.

  • Run the following command on your terminal: pip show whisper
  • Copy the location .
  • Edit the auto-subs script, at the very top, add the following lines (replace the path with the location from previous step):

`import sys

sys.path.append( "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages" )`

One other thing is to ensure the version of NumPy is accurate. Someone already mentioned downgrading NumPy; I had to do that as well.

MvP, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests