oracle / graalpython

A Python 3 implementation built on GraalVM
Other
1.2k stars 103 forks source link

Exception in thread "main" ModuleNotFoundError: No module named 'whisperx' #343

Closed asasas234 closed 1 year ago

asasas234 commented 1 year ago

I want to execute a python script through graalvm, and the error is as follows:

Exception in thread "main" ModuleNotFoundError: No module named 'whisperx'
    at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:399)
    at com.youtube.dubbing.transcription.service.WhisperXServiceImpl.main(WhisperXServiceImpl.java:37)

I confirmed that the script itself is fine, I can execute it normally in my python development tool, and I execute pip show whisperx The output is as follows:

Name: whisperx
Version: 3.1.1
Summary: Time-Accurate Automatic Speech Recognition using Whisper.
Home-page: https://github.com/m-bain/whisperx
Author: Max Bain
Author-email: 
License: MIT
Location: /Users/lizhibo/miniconda3/lib/python3.10/site-packages
Requires: faster-whisper, ffmpeg-python, nltk, pandas, pyannote.audio, setuptools, torch, torchaudio, transformers
Required-by: 

How can I solve it?

msimacek commented 1 year ago

Hi @asasas234, you need to eval import site in the context before importing anything from a virtualenv or a user site. See https://github.com/oracle/graalpython/blob/master/docs/user/Packages.md

Note you cannot use packages installed for CPython, the C extensions are not binary compatible. You have to install your packages into a separate environment created with GraalPy.

I see that whisperx dependes on transformers. That package currently doesn't work , it's work in progress (https://github.com/oracle/graalpython/issues/276)

asasas234 commented 1 year ago

master/docs/user/Packages.md

Thank you very much, for avoiding my detours, then I still consider running whisperX in the way of executing the shell in Java