pywhispercpp: _pywhispercpp module could not be found

Just did a standard PyPi download in my venv as per

pip install pywhispercpp

A standard script with:

import pywhispercpp.model as m

modelPath: str = ...
filePath: str = ...
outputPath: str = ...

model = m.Model('modelPath', n_threads=6)
segments = model.transcribe(filePath, token_timestamps=True, max_len=1)

with open(outputPath, 'w') as file:
    for segment in segments:
        file.write(segment.text + '\n')

Is failing with error:

Traceback (most recent call last):
  File "...\whisper_file.py", line 1, in <module>
    import pywhispercpp.model as m
  File "...\model.py", line 13, in <module>
    import _pywhispercpp as pw
ImportError: DLL load failed while importing _pywhispercpp: The specified module could not be found.

For reference, FFMpeg is installed:

╰─ ffmpeg -version                                                                                                   ─╯
ffmpeg version 4.4-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 58 (26 by maintainers)

Commits related to this issue

Most upvoted comments

When you have time for a quick Discord screenshare let’s try it. I’m in Eastern timezone (u.s.) just FYI.

I just discovered this and plan to benchmark it finally - so excited!

Fucking A…it worked. I put it in the “site-packages” folder, the “benchmark_whisper” folder, and the “pywhispercpp” folder and it worked…now it’s just a matter of narrowing it down to which folder hierarchy it should be in.

I put it in “site-packages” and It works

I just discovered this and plan to benchmark it finally - so excited!

Please do make a issue to post the benchmarks!

Also look into what I’ve been up to here: https://github.com/abdeladim-s/pywhispercpp/issues/49#issuecomment-2322741203

Damn, was looking forward to benchmarking cuda whisper.cpp. Anyways, fun little adventure tonight. Have a good one man. I’ll follow new releases for when you include the .dll and/or support GPU. How hard can it be, to support cuda, vulkan, openblas, etc. 😉

Fucking A…it worked. I put it in the “site-packages” folder, the “benchmark_whisper” folder, and the “pywhispercpp” folder and it worked…now it’s just a matter of narrowing it down to which folder hierarchy it should be in.

Great idea @BBC-Esq, Here is the whisper.dll file from ggerganov/whisper.cpp repo. Maybe include it in the same directroy as well, hopefully this will solve the issue