Persistent ImportError: diarizers due to pyannote.audio version conflict in installation instructions
Hello Kotoba Technologies Team,
I am encountering a persistent ImportError when trying to use the kotoba-whisper-v2.2 pipeline, specifically related to the diarizers package and its dependency on pyannote.audio.
Problem Description:
When attempting to run the model, I consistently receive the following error:
Encountered exception while importing diarizers: No module named 'pyannote.audio.core'
Traceback (most recent call last):
File "C:\code\doraemon\Scripts-Whisper\anime-whisper.py", line 12, in
pipe = pipeline(
...
ImportError: This modeling file requires the following packages that were not found in your environment: diarizers. Run pip install diarizers
This error occurs even after following the installation steps provided in the model's README.
Steps Taken & Observations:
Initial Installation Attempts: I followed the Transformers Usage section of your README:
Bash
pip install --upgrade pip
pip install --upgrade transformers accelerate torchaudio
pip install "punctuators==0.0.5"
pip install "pyannote.audio"
pip install git+https://github.com/huggingface/diarizers.git
I also ensured huggingface-cli login was successful and terms of use for pyannote/segmentation-3.0 and pyannote/speaker-diarization-3.1 were accepted.
Observed Dependency Conflict: The core issue appears to be a version incompatibility between pyannote.audio and the diarizers library.
When pip install "pyannote.audio" is run, it installs the latest stable version (currently pyannote.audio-3.3.2).
However, the diarizers library, installed via pip install git+https://github.com/huggingface/diarizers.git (which corresponds to diarizers==0.1 from commit f3c8ae500f55ad2b02b719fce1495ea2794ca9fe), has a dependency on an older pyannote.audio version (e.g., pyannote.audio-1.1.2) and an older omegaconf (e.g., omegaconf-1.4.1).
This leads to pip uninstalling the newer pyannote.audio (3.x) and omegaconf (2.x) to install the older versions required by diarizers. For example, this was observed in my logs:
Attempting uninstall: omegaconf
Found existing installation: omegaconf 2.3.0
Uninstalling omegaconf-2.3.0:
Successfully uninstalled omegaconf-2.3.0
...
Attempting uninstall: pyannote.audio
Found existing installation: pyannote.audio 3.3.2
Uninstalling pyannote.audio-3.3.2:
Successfully uninstalled pyannote.audio-3.3.2
Successfully installed ... omegaconf-1.4.1 pyannote.audio-1.1.2 pyannote.pipeline-1.5.2
The kotoba-whisper-v2.2 model, by referencing pyannote/segmentation-3.0 and pyannote/speaker-diarization-3.1, seems to expect pyannote.audio v3.x functionality, which is then broken by the diarizers installation.
Request for Guidance:
Could you please clarify the intended dependency versions for diarizers and pyannote.audio that are compatible with kotoba-whisper-v2.2? It appears there's a conflict in the current installation instructions.
Perhaps:
A newer version of diarizers is required that supports pyannote.audio v3.x.
A specific, older version of pyannote.audio should be installed to match the diarizers dependency.
Thank you for your time and assistance!
Environment Details:
Operating System: Windows
Python Version: 3.x (within a virtual environment)
Hi mrchrister,
I'm not part of the Kotoba Technologies Team, but I've experienced a problem similar to what you have described.
I've temporarily resolved running the following commands on a fresh virtualenv:
pip install --upgrade pip
pip install --upgrade transformers accelerate torchaudio
pip install "punctuators==0.0.5"
pip install git+https://github.com/huggingface/diarizers.git"
pip install "pyannote.audio==3.1.0"
pip install "numpy<2.0"
The last two commands (which I've added after those within the README} seems to override the packages with the expected versions.
I've not investigated though which of the suggested packages is the culprit of installing a later version of pyannote.audio or numpy, and therefore I'm not able to suggest a particular version pinning in such repositories.
thanks for your help. i get:
Installing collected packages: omegaconf, pyannote.pipeline, pyannote.audio
Attempting uninstall: omegaconf
Found existing installation: omegaconf 1.4.1
Uninstalling omegaconf-1.4.1:
Successfully uninstalled omegaconf-1.4.1
Attempting uninstall: pyannote.pipeline
Found existing installation: pyannote.pipeline 1.5.2
Uninstalling pyannote.pipeline-1.5.2:
Successfully uninstalled pyannote.pipeline-1.5.2
Attempting uninstall: pyannote.audio
Found existing installation: pyannote.audio 1.1.2
Uninstalling pyannote.audio-1.1.2:
Successfully uninstalled pyannote.audio-1.1.2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
hydra-core 0.11.3 requires omegaconf<1.5,>=1.4, but you have omegaconf 2.3.0 which is incompatible.
Successfully installed omegaconf-2.3.0 pyannote.audio-3.1.0 pyannote.pipeline-3.0.1
(kotoba) PS C:\code\virtualenv> pip install "numpy<2.0"
Collecting numpy<2.0
Downloading numpy-1.26.4-cp312-cp312-win_amd64.whl.metadata (61 kB)
Downloading numpy-1.26.4-cp312-cp312-win_amd64.whl (15.5 MB)
ββββββββββββββββββββββββββββββββββββββββ 15.5/15.5 MB 37.5 MB/s eta 0:00:00
Installing collected packages: numpy
Attempting uninstall: numpy
Found existing installation: numpy 2.2.6
Uninstalling numpy-2.2.6:
Successfully uninstalled numpy-2.2.6
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
numpy-minmax 0.5.0 requires numpy<3,>=2, but you have numpy 1.26.4 which is incompatible.
numpy-rms 0.6.0 requires numpy<3,>=2, but you have numpy 1.26.4 which is incompatible.
Successfully installed numpy-1.26.4
(kotoba) PS C:\code\virtualenv>
thanks for your help. i get:
Installing collected packages: omegaconf, pyannote.pipeline, pyannote.audio Attempting uninstall: omegaconf Found existing installation: omegaconf 1.4.1 Uninstalling omegaconf-1.4.1: Successfully uninstalled omegaconf-1.4.1 Attempting uninstall: pyannote.pipeline Found existing installation: pyannote.pipeline 1.5.2 Uninstalling pyannote.pipeline-1.5.2: Successfully uninstalled pyannote.pipeline-1.5.2 Attempting uninstall: pyannote.audio Found existing installation: pyannote.audio 1.1.2 Uninstalling pyannote.audio-1.1.2: Successfully uninstalled pyannote.audio-1.1.2 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. hydra-core 0.11.3 requires omegaconf<1.5,>=1.4, but you have omegaconf 2.3.0 which is incompatible. Successfully installed omegaconf-2.3.0 pyannote.audio-3.1.0 pyannote.pipeline-3.0.1 (kotoba) PS C:\code\virtualenv> pip install "numpy<2.0" Collecting numpy<2.0 Downloading numpy-1.26.4-cp312-cp312-win_amd64.whl.metadata (61 kB) Downloading numpy-1.26.4-cp312-cp312-win_amd64.whl (15.5 MB) ββββββββββββββββββββββββββββββββββββββββ 15.5/15.5 MB 37.5 MB/s eta 0:00:00 Installing collected packages: numpy Attempting uninstall: numpy Found existing installation: numpy 2.2.6 Uninstalling numpy-2.2.6: Successfully uninstalled numpy-2.2.6 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. numpy-minmax 0.5.0 requires numpy<3,>=2, but you have numpy 1.26.4 which is incompatible. numpy-rms 0.6.0 requires numpy<3,>=2, but you have numpy 1.26.4 which is incompatible. Successfully installed numpy-1.26.4 (kotoba) PS C:\code\virtualenv>
Have you found a way to make it work?
Not the diarization, but I'm using kotoba through whisperx now