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

Conflicting dependencies while installing requirements.txt #188

Open
AnshumanParidaIL opened this issue May 21, 2024 · 16 comments
Open

Conflicting dependencies while installing requirements.txt #188

AnshumanParidaIL opened this issue May 21, 2024 · 16 comments

Comments

@AnshumanParidaIL
Copy link

ERROR: Cannot install -r requirements.txt (line 3), -r requirements.txt (line 4), -r requirements.txt (line 6) and whisperx because these package versions have conflicting dependencies.

The conflict is caused by:
whisperx 3.1.1 depends on torchaudio>=2
pyannote-audio 3.1.1 depends on torchaudio>=2.0.0
demucs 4.1.0a2 depends on torchaudio<2.1 and >=0.8
ctc-forced-aligner 0.1 depends on torchaudio>=2.1.0

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict
@MahmoudAshraf97
Copy link
Owner

Should be solved now

@AnshumanParidaIL
Copy link
Author

Cloned the updated repo and installed requirements, this time I encountered this error:-

 Running setup.py install for ctc-forced-aligner ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for ctc-forced-aligner did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-l_it1chw/setup.py", line 2, in <module>
          from torch.utils import cpp_extension
        File "/home/ubuntu/anshuman/sd/env/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 28, in <module>
          from pkg_resources import packaging  # type: ignore[attr-defined]
      ImportError: cannot import name 'packaging' from 'pkg_resources' (/home/ubuntu/anshuman/sd/env/lib/python3.10/site-packages/pkg_resources/__init__.py)
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> ctc-forced-aligner

I am using python 3.10.12.

@MahmoudAshraf97
Copy link
Owner

update setuptools
pip install setuptools -U --force-reinstall

@mjcarag
Copy link

mjcarag commented Jul 24, 2024

image
having this error

@MahmoudAshraf97
Copy link
Owner

@mjcarag the stack trace is not complete, please share it as a text

@mjcarag
Copy link

mjcarag commented Jul 25, 2024

Please see error encountered:

ERROR: Exception:
Traceback (most recent call last):
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\cli\base_command.py", line 179, in exc_logging_wrapper
status = run_func(*args)
^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\cli\req_command.py", line 67, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\commands\install.py", line 377, in run
requirement_set = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\resolver.py", line 95, in resolve
result = self._result = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 427, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 239, in _attempt_to_pin_criterion
criteria = self._get_updated_criteria(candidate)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 230, in _get_updated_criteria
self._add_to_criteria(criteria, requirement, parent=candidate)
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria
if not criterion.candidates:
^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\resolvelib\structs.py", line 156, in bool
return bool(self._sequence)
^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 174, in bool
return any(self)
^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 162, in
return (c for c in iterator if id(c) not in self._incompatible_ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 53, in _iter_built
candidate = func()
^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\factory.py", line 185, in _make_candidate_from_link
base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\factory.py", line 231, in _make_base_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 303, in init
super().init(
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 158, in init
self.dist = self._prepare()
^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 235, in _prepare
dist = self._prepare_distribution()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 314, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\operations\prepare.py", line 527, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\operations\prepare.py", line 642, in _prepare_linked_requirement
dist = _get_prepared_distribution(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\operations\prepare.py", line 72, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\distributions\sdist.py", line 56, in prepare_distribution_metadata
self._install_build_reqs(finder)
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\distributions\sdist.py", line 126, in _install_build_reqs
build_reqs = self._get_build_requires_wheel()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\distributions\sdist.py", line 103, in _get_build_requires_wheel
return backend.get_requires_for_build_wheel()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_internal\utils\misc.py", line 709, in get_requires_for_build_wheel
return super().get_requires_for_build_wheel(config_settings=cs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\pyproject_hooks_impl.py", line 166, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\pyproject_hooks_impl.py", line 321, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 77, in build_backend
obj = import_module(mod_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PC\AppData\Local\Programs\Python\Python312\Lib\importlib_init
.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1310, in _find_and_load_unlocked
File "", line 488, in _call_with_frames_removed
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in call_with_frames_removed
File "C:\Users\PC\AppData\Local\Temp\pip-build-env-b565xk92\overlay\Lib\site-packages\setuptools_init
.py", line 10, in
import distutils.core
ModuleNotFoundError: No module named 'distutils'

@MahmoudAshraf97
Copy link
Owner

pip install distutils

@mjcarag
Copy link

mjcarag commented Jul 25, 2024

ERROR: Could not find a version that satisfies the requirement distutils (from versions: none)
ERROR: No matching distribution found for distutils

am having this error when trying to pip install distutils

tried to pip install setuptools and got different error
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
Traceback (most recent call last):
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 112, in get_requires_for_build_wheel
backend = _build_backend()
^^^^^^^^^^^^^^^^
File "D:\Office Works\VSC\whisper-diarization-main\myenv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 77, in build_backend
obj = import_module(mod_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PC\AppData\Local\Programs\Python\Python312\Lib\importlib_init
.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1310, in _find_and_load_unlocked
File "", line 488, in _call_with_frames_removed
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\Users\PC\AppData\Local\Temp\pip-build-env-5213r1q\overlay\Lib\site-packages\setuptools_init.py", line 16, in
import setuptools.version
File "C:\Users\PC\AppData\Local\Temp\pip-build-env-_5213r1q\overlay\Lib\site-packages\setuptools\version.py", line 1, in
import pkg_resources
File "C:\Users\PC\AppData\Local\Temp\pip-build-env-5213r1q\overlay\Lib\site-packages\pkg_resources_init.py", line 2172, in
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@AbsurdSyssie
Copy link

I also get the module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'? error
Python 3.9

@MahmoudAshraf97
Copy link
Owner

pip install --upgrade pip setuptools

@AbsurdSyssie
Copy link

I have tried
python -m pip install --upgrade pip setuptools wheel
python -m pip install numpy==1.23.5
python -m pip cache purge
del /q /f /s %temp%*
conda update conda
conda update -c conda-forge --all

@MahmoudAshraf97
Copy link
Owner

I don't know unfortunately, maybe try again with a clean environment

@AbsurdSyssie
Copy link

I also did

@owend
Copy link

owend commented Aug 9, 2024

I ran into the same error on macos + homebrew + python 3.12
It looks like python 3.12 (and pip) removed ImpImporter: https://stackoverflow.com/a/77364602
The error also seems to be a transitive dependency on numpy 1.23 included from nemo_toolkit? Numpy 1.26 might fix it?

Collecting numpy<1.24,>=1.22 (from nemo_toolkit!=1.22.0,!=1.23.0->nemo_toolkit[asr]!=1.22.0,!=1.23.0->-r requirements.txt (line 2))
...
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

I was able to install using python 3.11 (installed via homebrew) with the following steps:

python3.11 -m venv venv
source venv/bin/activate
pip install --upgrade Cython setuptools wheel
pip install -r requirements.txt 

@kirahman2
Copy link

I'm using ubuntu 22.04 from the microsoft store on Windows 11. Here is the bash script that I put together. This got everything working seamlessly as of August 2024.

#!/bin/bash

# Create a new conda environment
conda create -n whisper_diar2 python=3.10 --yes

# Initialize conda and activate the new environment
source ~/miniconda3/etc/profile.d/conda.sh
conda activate whisper_diar2

# Upgrade pip
pip install --upgrade pip

# Install JupyterLab and IPython kernel
conda install -c conda-forge jupyterlab --yes
conda install ipykernel --yes
python -m ipykernel install --user --name whisper_diar2 --display-name "whisper_diar2"

# Reinstall PyTorch with CUDA support
#pip uninstall torch --yes
#conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia --yes

# Install Cython and FFmpeg
#pip install cython
sudo apt update && sudo apt install -y cython3 ffmpeg

# https://github.com/MahmoudAshraf97/whisper-diarization/issues/188#issuecomment-2277862623
pip install --upgrade Cython setuptools wheel

# Install other required Python packages
pip install -r requirements.txt

# Install Nemo toolkit (you can modify the version if needed)
pip install nemo_toolkit==1.18.1

# notebook pip installs
pip install git+https://github.com/m-bain/whisperX.git@78dcfaab51005aa703ee21375f81ed31bc248560
pip install --no-build-isolation nemo_toolkit[asr]==1.23.0
pip install --no-deps git+https://github.com/facebookresearch/demucs#egg=demucs
pip install git+https://github.com/oliverguhr/deepmultilingualpunctuation.git
pip install git+https://github.com/MahmoudAshraf97/ctc-forced-aligner.git

# https://github.com/MahmoudAshraf97/whisper-diarization/issues/202
pip uninstall huggingface_hub --yes
pip install huggingface-hub==0.20.3

echo "Installation complete. The environment 'whisper_diar2' is set up and ready to use."

@sefatunckanat
Copy link

I'm using ubuntu 22.04 from the microsoft store on Windows 11. Here is the bash script that I put together. This got everything working seamlessly as of August 2024.

#!/bin/bash

# Create a new conda environment
conda create -n whisper_diar2 python=3.10 --yes

# Initialize conda and activate the new environment
source ~/miniconda3/etc/profile.d/conda.sh
conda activate whisper_diar2

# Upgrade pip
pip install --upgrade pip

# Install JupyterLab and IPython kernel
conda install -c conda-forge jupyterlab --yes
conda install ipykernel --yes
python -m ipykernel install --user --name whisper_diar2 --display-name "whisper_diar2"

# Reinstall PyTorch with CUDA support
#pip uninstall torch --yes
#conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia --yes

# Install Cython and FFmpeg
#pip install cython
sudo apt update && sudo apt install -y cython3 ffmpeg

# https://github.com/MahmoudAshraf97/whisper-diarization/issues/188#issuecomment-2277862623
pip install --upgrade Cython setuptools wheel

# Install other required Python packages
pip install -r requirements.txt

# Install Nemo toolkit (you can modify the version if needed)
pip install nemo_toolkit==1.18.1

# notebook pip installs
pip install git+https://github.com/m-bain/whisperX.git@78dcfaab51005aa703ee21375f81ed31bc248560
pip install --no-build-isolation nemo_toolkit[asr]==1.23.0
pip install --no-deps git+https://github.com/facebookresearch/demucs#egg=demucs
pip install git+https://github.com/oliverguhr/deepmultilingualpunctuation.git
pip install git+https://github.com/MahmoudAshraf97/ctc-forced-aligner.git

# https://github.com/MahmoudAshraf97/whisper-diarization/issues/202
pip uninstall huggingface_hub --yes
pip install huggingface-hub==0.20.3

echo "Installation complete. The environment 'whisper_diar2' is set up and ready to use."

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

7 participants