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

ModuleNotFoundError: No module named 'stable_whisper' #239

Open
danini1705 opened this issue Nov 3, 2023 · 15 comments
Open

ModuleNotFoundError: No module named 'stable_whisper' #239

danini1705 opened this issue Nov 3, 2023 · 15 comments

Comments

@danini1705
Copy link

I am using a script from another developer that is using Stable-ts

After discussing the issue with the developer he is sadly not able to help.
So here I am asking.

How can we fix this?
I installed stable-ts and whisper, but apparently it doesn't work.
I am using a script for davinci resolve

@jianfch
Copy link
Owner

jianfch commented Nov 4, 2023

Check if Stable-ts is in the environment with pip show stable-ts and make sure the script runs in the same environment.
If you still get the error, try to reinstall Stable-ts, pip install --upgrade --no-deps --force-reinstall stable-ts, or install it in a new environment.

@danini1705
Copy link
Author

I tried both
Here is my output

Name: stable-ts
Version: 2.13.1
Summary: Modifies OpenAI's Whisper to produce more reliable timestamps.
Home-page: https://github.com/jianfch/stable-ts
Author: Jian
Author-email:
License: MIT
Location: /opt/homebrew/lib/python3.11/site-packages
Requires: ffmpeg-python, more-itertools, numpy, openai-whisper, torch, torchaudio, tqdm, transformers
Required-by:

And when I run the script:
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'

Also, I reinstalled it like you said

@jianfch
Copy link
Owner

jianfch commented Nov 7, 2023

It is likely due the script not running the the same environment that Stable-ts was installed in.

@jianfch
Copy link
Owner

jianfch commented Dec 12, 2023

Have you tried starting davinci resolve from the command line?

@danini1705
Copy link
Author

danini1705 commented Dec 12, 2023 via email

@jianfch
Copy link
Owner

jianfch commented Dec 12, 2023

You mean opening it via terminal?

Yes

@danini1705
Copy link
Author

danini1705 commented Dec 13, 2023 via email

@jianfch
Copy link
Owner

jianfch commented Dec 13, 2023

You can try to install stable-ts in code by running these lines the python console within davinci resolve:

import sys
import subprocess
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'stable-ts'])

If you still get the error, try to restart the console or davinci resolve.

@danini1705
Copy link
Author

danini1705 commented Dec 13, 2023 via email

@danini1705
Copy link
Author

So I am the exception where nothing works? :D

@danini1705
Copy link
Author

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

@ThisIsntTheWay
Copy link

What is the version of your default python interpreter, i.e. what does python --version print?
I noticed that your pip show stable-ts command indicates that the package was installed into /opt/homebrew/lib/python3.11/site-packages.

I've had the same issue just now, and it was because I am actually using Python 3.9, yet pip was installing stuff into the site-packages for version 3.10.
I fixed this by uninstalling the pip package from my distro and installing it manually using the get-pip.py script:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.9 get-pip.py
#     ^^^ Or whatever version you intend to install pip for

Afterwards, the packages got put into the right environment and I was able to use stable-ts.

@danini1705
Copy link
Author

I am using Python 3.11.6 :)

@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

@ParkerRex
Copy link

make sure the davinci python executable has the right packages and path

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

5 participants