fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

"ERROR: Cannot install fairseq and fairseq==0.12.2 because these package versions have conflicting dependencies."

Open simonphuongnguyen opened this issue 2 years ago • 27 comments

🐛 Bug

ERROR: Cannot install fairseq and fairseq==0.12.2 because these package versions have conflicting dependencies.

Environment

  • fairseq Version (e.g., 1.0 or main): 0.12.2
  • PyTorch Version (e.g., 1.0): torch-2.3.1
  • OS (e.g., Linux): Window 11
  • How you installed fairseq (pip, source): using pip but complie with vscode 2022 ( CMake Tools ).
  • Build command you used (if compiling from source): py -3.10 -m pip install --editable ./
  • Python version: 3.10.3
  • CUDA/cuDNN version: Not install yet. Fisrt time download fairseq.
  • GPU models and configuration: NVIDIA GeForce RTX 3050. Drive is install (state version). Fisrt time download fairseq.
  • Any other relevant information: Not install yet. Fisrt time download fairseq.

i use ther command to install

git clone https://github.com/pytorch/fairseq
cd fairseq
py -3.10 -m pip install --editable ./

There is a full log

PS D:\html\AI Cover voice\fairseq> py -3.10 -m pip install ./
Processing d:\html\ai cover voice\fairseq
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: cffi in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from fairseq==0.12.2) (1.16.0)
Requirement already satisfied: cython in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from fairseq==0.12.2) (3.0.10)
Collecting hydra-core<1.1,>=1.0.7 (from fairseq==0.12.2)
  Using cached hydra_core-1.0.7-py3-none-any.whl.metadata (3.7 kB)
Collecting omegaconf<2.1 (from fairseq==0.12.2)
  Using cached omegaconf-2.0.6-py3-none-any.whl.metadata (3.0 kB)
WARNING: Ignoring version 2.0.6 of omegaconf since it has invalid metadata:
Requested omegaconf<2.1 from https://files.pythonhosted.org/packages/d0/eb/9d63ce09dd8aa85767c65668d5414958ea29648a0eec80a4a7d311ec2684/omegaconf-2.0.6-py3-none-any.whl (from fairseq==0.12.2) has invalid metadata: .* suffix can only be used with `==` or `!=` operators
    PyYAML (>=5.1.*)
            ~~~~~~^
Please use pip<24.1 if you need to use this version.
  Using cached omegaconf-2.0.5-py3-none-any.whl.metadata (3.0 kB)
WARNING: Ignoring version 2.0.5 of omegaconf since it has invalid metadata:
Requested omegaconf<2.1 from https://files.pythonhosted.org/packages/e5/f6/043b6d255dd6fbf2025110cea35b87f4c5100a181681d8eab496269f0d5b/omegaconf-2.0.5-py3-none-any.whl (from fairseq==0.12.2) has invalid metadata: .* suffix can only be used with `==` or `!=` operators
    PyYAML (>=5.1.*)
            ~~~~~~^
Please use pip<24.1 if you need to use this version.
  Using cached omegaconf-2.0.4-py3-none-any.whl.metadata (3.0 kB)
WARNING: Ignoring version 2.0.4 of omegaconf since it has invalid metadata:
Requested omegaconf<2.1 from https://files.pythonhosted.org/packages/92/b1/4f3023143436f12c98bab53f0b3db617bd18a7d223627d5030e13a7b4fc2/omegaconf-2.0.4-py3-none-any.whl (from fairseq==0.12.2) has invalid metadata: .* suffix can only be used with `==` or `!=` operators
    PyYAML (>=5.1.*)
            ~~~~~~^
Please use pip<24.1 if you need to use this version.
  Using cached omegaconf-2.0.3-py3-none-any.whl.metadata (3.0 kB)
WARNING: Ignoring version 2.0.3 of omegaconf since it has invalid metadata:
Requested omegaconf<2.1 from https://files.pythonhosted.org/packages/29/08/a88210c2c1aa0a3f65f05d8a6c98939ccb84b6fb982aa6567dec4e6773f9/omegaconf-2.0.3-py3-none-any.whl (from fairseq==0.12.2) has invalid metadata: .* suffix can only be used with `==` or `!=` operators
    PyYAML (>=5.1.*)
            ~~~~~~^
Please use pip<24.1 if you need to use this version.
  Using cached omegaconf-2.0.2-py3-none-any.whl.metadata (3.0 kB)
WARNING: Ignoring version 2.0.2 of omegaconf since it has invalid metadata:
Requested omegaconf<2.1 from https://files.pythonhosted.org/packages/72/fe/f8d162aa059fb4f327fd75144dd69aa7e8acbb6d8d37013e4638c8490e0b/omegaconf-2.0.2-py3-none-any.whl (from fairseq==0.12.2) has invalid metadata: .* suffix can only be used with `==` or `!=` operators
    PyYAML (>=5.1.*)
            ~~~~~~^
Please use pip<24.1 if you need to use this version.
  Using cached omegaconf-2.0.1-py3-none-any.whl.metadata (3.0 kB)
WARNING: Ignoring version 2.0.1 of omegaconf since it has invalid metadata:
Requested omegaconf<2.1 from https://files.pythonhosted.org/packages/86/ec/605805e60abdb025b06664d107335031bb8ebdc52e0a90bdbad6a7130279/omegaconf-2.0.1-py3-none-any.whl (from fairseq==0.12.2) has invalid metadata: .* suffix can only be used with `==` or `!=` operators
    PyYAML (>=5.1.*)
            ~~~~~~^
Please use pip<24.1 if you need to use this version.
  Using cached omegaconf-2.0.0-py3-none-any.whl.metadata (3.5 kB)
Requirement already satisfied: numpy>=1.21.3 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from fairseq==0.12.2) (1.23.5)
Collecting regex (from fairseq==0.12.2)
  Using cached regex-2024.5.15-cp310-cp310-win_amd64.whl.metadata (41 kB)
Collecting sacrebleu>=1.4.12 (from fairseq==0.12.2)
  Using cached sacrebleu-2.4.2-py3-none-any.whl.metadata (58 kB)
Requirement already satisfied: torch>=1.13 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from fairseq==0.12.2) (2.0.1+cu118)
Requirement already satisfied: tqdm in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from fairseq==0.12.2) (4.65.0)
Collecting bitarray (from fairseq==0.12.2)
  Using cached bitarray-2.9.2-cp310-cp310-win_amd64.whl.metadata (35 kB)
Requirement already satisfied: torchaudio>=0.8.0 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from fairseq==0.12.2) (2.3.1+cu121)
Requirement already satisfied: scikit-learn in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from fairseq==0.12.2) (1.5.0)
Requirement already satisfied: packaging in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from fairseq==0.12.2) (24.1)
Collecting omegaconf<2.1 (from fairseq==0.12.2)
  Using cached omegaconf-2.0.6-py3-none-any.whl.metadata (3.0 kB)
WARNING: Ignoring version 2.0.6 of omegaconf since it has invalid metadata:
Requested omegaconf<2.1 from https://files.pythonhosted.org/packages/d0/eb/9d63ce09dd8aa85767c65668d5414958ea29648a0eec80a4a7d311ec2684/omegaconf-2.0.6-py3-none-any.whl (from fairseq==0.12.2) has invalid metadata: .* suffix can only be used with `==` or `!=` operators
    PyYAML (>=5.1.*)
            ~~~~~~^
Please use pip<24.1 if you need to use this version.
  Using cached omegaconf-2.0.5-py3-none-any.whl.metadata (3.0 kB)
WARNING: Ignoring version 2.0.5 of omegaconf since it has invalid metadata:
Requested omegaconf<2.1 from https://files.pythonhosted.org/packages/e5/f6/043b6d255dd6fbf2025110cea35b87f4c5100a181681d8eab496269f0d5b/omegaconf-2.0.5-py3-none-any.whl (from fairseq==0.12.2) has invalid metadata: .* suffix can only be used with `==` or `!=` operators
    PyYAML (>=5.1.*)
            ~~~~~~^
Please use pip<24.1 if you need to use this version.
INFO: pip is looking at multiple versions of hydra-core to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install fairseq and fairseq==0.12.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    fairseq 0.12.2 depends on omegaconf<2.1
    hydra-core 1.0.7 depends on omegaconf<2.1 and >=2.0.5

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Something went wrong when install.

simonphuongnguyen avatar Jun 24 '24 08:06 simonphuongnguyen

Has fix the torch issue so update the bug info

simonphuongnguyen avatar Jun 24 '24 09:06 simonphuongnguyen

Facing the same.

arjbah avatar Jun 25 '24 10:06 arjbah

This issue is connected with https://github.com/SociallyIneptWeeb/AICoverGen/issues/133#issue-2372232845 ploblem

simonphuongnguyen avatar Jun 25 '24 11:06 simonphuongnguyen

@Beterng , the best way is, to install without version specifications, as it would by default install the latest versions of all the libraries. And if there are cases, when the package itself is not updated by the org to match the latter versions, then in that case, unfortunately, we need to install it accordingly.

Siddharth-Latthe-07 avatar Jun 28 '24 09:06 Siddharth-Latthe-07

I have the same problem.

Title

pip install fairseq fails due to invalid metadata for PyYAML dependency in omegaconf

Issue Description

Environment:

  • Ubuntu 22.04
  • Conda environment: streamspeech
  • Python 3.10
  • GCC version: 12.3.0

Steps to Reproduce:

  1. Create and activate conda environment:

    conda create -n streamspeech python=3.10 -y
    conda activate streamspeech
    
  2. Install dependencies:

    conda install pytorch=2.0.1 torchvision torchaudio cudatoolkit=11.7 -c pytorch
    sudo apt-get update
    sudo apt-get install -y build-essential python3-dev
    pip install cython numpy
    pip install --upgrade pip setuptools
    pip install PyYAML
    
  3. Check PyYAML version:

    python -c "import yaml; print(yaml.__version__)"
    # Output: 6.0.1
    
  4. Try to install fairseq:

    pip install --editable ./ --no-build-isolation
    

Observed Behavior:

  • The installation process fails with the following errors:
    WARNING: Error parsing dependencies of omegaconf: .* suffix can only be used with `==` or `!=` operators
        PyYAML (>=5.1.*)
                ~~~~~~^
    
    ERROR: Exception:
    Traceback (most recent call last):
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3070, in _dep_map
        return self.__dep_map
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2863, in __getattr__
        raise AttributeError(attr)
    AttributeError: _DistInfoDistribution__dep_map
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py", line 36, in __init__
        parsed = _parse_requirement(requirement_string)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 62, in parse_requirement
        return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 80, in _parse_requirement
        url, specifier, marker = _parse_requirement_details(tokenizer)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 118, in _parse_requirement_details
        specifier = _parse_specifier(tokenizer)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 214, in _parse_specifier
        parsed_specifiers = _parse_version_many(tokenizer)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 229, in _parse_version_many
        tokenizer.raise_syntax_error(
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_tokenizer.py", line 167, in raise_syntax_error
        raise ParserSyntaxError(
    pip._vendor.packaging._tokenizer.ParserSyntaxError: .* suffix can only be used with `==` or `!=` operators
        PyYAML (>=5.1.*)
                ~~~~~~^
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 179, in exc_logging_wrapper
        status = run_func(*args)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
        return func(self, options, args)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 377, in run
        requirement_set = resolver.resolve(
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
        result = self._result = resolver.resolve(
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
        state = resolution.resolve(requirements, max_rounds=max_rounds)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 427, in resolve
        failure_causes = self._attempt_to_pin_criterion(name)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
        criteria = self._get_updated_criteria(candidate)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 247, in get_dependencies
        return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 247, in <listcomp>
        return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 401, in iter_dependencies
        for r in self.dist.iter_dependencies():
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/metadata/pkg_resources.py", line 247, in iter_dependencies
        return self._dist.requires(extras)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2786, in requires
        dm = self._dep_map
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3072, in _dep_map
        self.__dep_map = self._compute_dependencies()
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3082, in _compute_dependencies
        reqs.extend(parse_requirements(req))
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3135, in __init__
        super().__init__(requirement_string)
      File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py", line 38, in __init__
        raise InvalidRequirement(str(e)) from e
    pip._vendor.packaging.requirements.InvalidRequirement: .* suffix can only be used with `==` or `!=` operators
        PyYAML (>=5.1.*)
                ~~~~~~^
    

Expected Behavior: fairseq should be installed without errors.

Additional Information:

  • PyYAML version: 6.0.1
  • omegaconf version: 2.0.5
  • hydra-core version: 1.0.7
  • torch version: 2.3.1
  • pip version: 23.1

Notes:

  • The PyYAML dependency in omegaconf has an invalid metadata format that causes the error.
  • Running as root might cause permissions and conflicts, but switching to a non-root user does not resolve the dependency issues.

Steps Tried:

  1. Upgrading/downgrading pip, setuptools, and wheel.
  2. Installing specific versions of PyYAML and omegaconf.
  3. Setting up a new conda environment with specific versions of dependencies.
  4. Verifying GCC installation and setting default versions.

Request for Help: I need assistance in resolving this installation failure. Any guidance or solutions would be appreciated.

Contact Information: [email protected]

Labels

  • needs triage
  • bug

Gan-Xing avatar Jul 01 '24 02:07 Gan-Xing

@Gan-Xing , The issue seems to stem from an invalid version specifier in the omegaconf package's metadata. try out these steps, and let me know if it works,

  1. Create a patched version of omegaconf by:- Download the omegaconf source code.
git clone https://github.com/omry/omegaconf.git
cd omegaconf
  1. edit the setup.py or setup.cfg file to correct the version specifier for PyYAML. Open the setup.cfg file (or setup.py if there is no setup.cfg) and change the PyYAML requirement from PyYAML (>=5.1.*) to PyYAML (>=5.1).

  2. Install the above patch version before the fairseq

python setup.py sdist
pip install dist/omegaconf-<version>.tar.gz
  1. Proceed with installing fairseq:
pip install --editable ./ --no-build-isolation

let me know, if it works

Siddharth-Latthe-07 avatar Jul 01 '24 04:07 Siddharth-Latthe-07

@Siddharth-Latthe-07 I don't see PyYAML version lines in the 2 setup.* files.

Geremia avatar Jul 17 '24 04:07 Geremia

@Geremia sorry my bad, not in setup.* files in the requirements/base.txt file, Change the version specifier from PyYAML (>=5.1.*) to PyYAML (>=5.1). and then proceed with above steps to install fairseq:- pip install fairseq

Siddharth-Latthe-07 avatar Jul 17 '24 05:07 Siddharth-Latthe-07

@Siddharth-Latthe-07 It builds omegaconf 2.4.0.dev3, and I still get the same issue installing fairseq:

ERROR: Cannot install fairseq and fairseq==0.12.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    fairseq 0.12.2 depends on omegaconf<2.1
    hydra-core 1.0.7 depends on omegaconf<2.1 and >=2.0.5

I don't know why it keeps Downloading omegaconf-2.0.5-py3-none-any.whl.metadata.

Geremia avatar Jul 17 '24 18:07 Geremia

@Siddharth-Latthe-07 I had to git checkout v2.0.6 first. That fixed the problem.

Geremia avatar Jul 18 '24 04:07 Geremia

@Geremia so, the issue seems to have caused due version control, switching to relevant version of git helped to solve the dependency conflicts ig.

Siddharth-Latthe-07 avatar Jul 18 '24 04:07 Siddharth-Latthe-07

The problem may start with the pip version. I have downgraded to ver 20 and then it works. Issue close.

simonphuongnguyen avatar Jul 21 '24 08:07 simonphuongnguyen

Great downgraded pip to version 20 and now nothing works anymore. Everything haywire. Will rebuild the venv.

roelfrenkema avatar Aug 12 '24 15:08 roelfrenkema

The issue is not solved, downgrading the package manager is only a temporary hack. This isn't a pip bug.

asumagic avatar Sep 06 '24 12:09 asumagic

来信已收到。谢谢。——此为自动回复。Votre courrier est bien re?0?4u,merci.//C'est une réponse automatique.Your e-mail has been received,thanks.//This is an automatic reply.

Gan-Xing avatar Sep 06 '24 12:09 Gan-Xing

I downgraded my pip to 24.0 and now the pip install --editable command ran smoothly! Somebody else mentioned downgrading to 20, but that only caused other problems for me.

Spudra avatar Sep 10 '24 11:09 Spudra

I downgraded my pip to 24.0 and now the pip install --editable command ran smoothly! Somebody else mentioned downgrading to 20, but that only caused other problems for me.

same here, pip install pip == 24 after that fairseq downloaded fine

WFAR0 avatar Sep 11 '24 14:09 WFAR0

Can confirm - downgrading pip from 24.2 to 24.0 solved it for me. Fresh conda venv with Python 3.10.

stet-stet avatar Sep 25 '24 01:09 stet-stet

It works for me too, thx!

gustavoruske avatar Oct 04 '24 12:10 gustavoruske

Downgrading doesn't work at all. Tried pip 19, 24.0, 24.1

Kishlay-notabot avatar Oct 17 '24 09:10 Kishlay-notabot