pythonpippackagedependenciesfairseq

pip dependency conflict requires same version of package


I am trying to install fairseq and I had to modify the setup.py file to resolve a dependency conflict. However I still get a conflict error that I can't understand, as it seems that the conflicting packages require the same version of omegaconf. Here is the console output :


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

Here are the modified requirements in setup.py :

install_requires=[
            "cffi",
            "cython",
            "hydra-core==1.0.7",
            "omegaconf<2.1",
            "numpy>=1.21.3",
            "regex",
            "sacrebleu>=1.4.12",
            "torch>=1.13",
            "tqdm",
            "bitarray",
            "torchaudio>=0.8.0",
            "scikit-learn",
            "packaging",
        ]

Solution

  • Try installing a specific version of omegaconf that satifies the requirements

    pip install omegaconf==2.0.9
    

    As long as it keeps within the boundaries of 2.0.5 and 2.1 you should be fine, i only specified 2.0.9 as it is the newest version within in the boundaries.

    Edit:

    Also possible try and remove your current versions of omegaconf that do not fit the boundaries required. You can find the version you have installed with either

    pip list
    

    or

    pip show omegaconf
    

    then if you find that you have a version installed that exceeds 2.1 or below 2.0.5 you can delete it

    pip uninstall omegaconf