facebookresearch / fairseq2

FAIR Sequence Modeling Toolkit 2
https://facebookresearch.github.io/fairseq2/
MIT License
686 stars 79 forks source link

pip3 install fairseq2 - doesn't work #471

Open twerff opened 5 months ago

twerff commented 5 months ago

I'm trying to install seamlessm4q on my Macbook M2. Installation results in an error related to fairseq2. So, I tried to manually install fairseq using % pip3 install fairseq2. It gives the following error:

Collecting fairseq2
  Downloading fairseq2-0.2.1-py3-none-any.whl.metadata (1.2 kB)
INFO: pip is looking at multiple versions of fairseq2 to determine which version is compatible with other requirements. This could take a while.
  Downloading fairseq2-0.2.0-py3-none-any.whl.metadata (1.2 kB)
  Downloading fairseq2-0.1.1-py3-none-any.whl.metadata (1.2 kB)
  Downloading fairseq2-0.1.0-py3-none-any.whl.metadata (1.2 kB)
ERROR: Cannot install fairseq2==0.1.0, fairseq2==0.1.1, fairseq2==0.2.0 and fairseq2==0.2.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    fairseq2 0.2.1 depends on fairseq2n==0.2.1
    fairseq2 0.2.0 depends on fairseq2n==0.2.0
    fairseq2 0.1.1 depends on fairseq2n==0.1.1
    fairseq2 0.1.0 depends on fairseq2n==0.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

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

Can anyone help me out?

MountainGG commented 4 months ago

same problem on ubuntu22.04(wsl2)

AjayArvind2207 commented 3 months ago

Same issue on Ubuntu-24.04(wsl2). Tried installing from source too but no luck. Any advice would be helpful!

AjayArvind2207 commented 3 months ago

@MountainGG I managed to fix mine, turns out I was on python 3.12 and fairseq2 doesnt seem to be supported on it yet, so I just downgraded my virtual env to python3.10 and I was able to install it. Hope this helps!

yinde0 commented 3 months ago

I have downgraded mine to python 3.90 and I am still getting the same error.

silentlit commented 2 months ago

Check the python env: import platform platform.platform() or platform.processor() If you got _'macOS-10.16-x8664-i386-64bit' or 'i386', that is the env matter.

You could try to create a new env like: CONDA_SUBDIR=osx-arm64 conda create -n ENV_NAME python=3.XX and you would create a arm env. Try to check the env import platform;platform.platform();platform.processor(). If the env correct, you will got 'macOS-14.5-arm64-arm-64bit' and 'arm'.

Reference: MacOS M1 system is detected as ARM by Python package even though I'm using Rosetta

retif commented 1 month ago

Python downgrade to 3.10 fixed the issue for me. If higher python version is not supported - it would be good to have a sane error message when trying to install on python 3.12 for example.

(fb-vits) :~/projects/ml/seamless_communication$ pip install fairseq2
Collecting fairseq2
  Using cached fairseq2-0.2.1-py3-none-any.whl.metadata (1.2 kB)
INFO: pip is looking at multiple versions of fairseq2 to determine which version is compatible with other requirements. This could take a while.
  Using cached fairseq2-0.2.0-py3-none-any.whl.metadata (1.2 kB)
  Using cached fairseq2-0.1.1-py3-none-any.whl.metadata (1.2 kB)
  Using cached fairseq2-0.1.0-py3-none-any.whl.metadata (1.2 kB)
ERROR: Cannot install fairseq2==0.1.0, fairseq2==0.1.1, fairseq2==0.2.0 and fairseq2==0.2.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    fairseq2 0.2.1 depends on fairseq2n==0.2.1
    fairseq2 0.2.0 depends on fairseq2n==0.2.0
    fairseq2 0.1.1 depends on fairseq2n==0.1.1
    fairseq2 0.1.0 depends on fairseq2n==0.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 to attempt to solve the dependency conflict

this kind of error has no valuable information to understand that issue is python version, it says about package version conflicts.

I have PopOS 22.04(Ubuntu flavor) pytorch 2.4.0