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

Cannot install fairseq==0.10.2 with python 3.9 #3535

Open
louismartin opened this issue May 5, 2021 · 23 comments
Open

Cannot install fairseq==0.10.2 with python 3.9 #3535

louismartin opened this issue May 5, 2021 · 23 comments

Comments

@louismartin
Copy link
Contributor

I don't seem to be able to install fairseq==0.10.2 with python 3.9 on macOS 11.3

$ pip install fairseq==0.10.2
Collecting fairseq==0.10.2
  Using cached fairseq-0.10.2.tar.gz (938 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/louismartin/miniconda3/envs/dev3.9/bin/python /Users/louismartin/miniconda3/envs/dev3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/_4/yxn93yzn14g0_0k2rmctcc1x8lvpn4/T/tmpok_9kdi5
       cwd: /private/var/folders/_4/yxn93yzn14g0_0k2rmctcc1x8lvpn4/T/pip-install-c4qbk_3i/fairseq_751efca8a5d547ada5c29fe71ec11ded
  Complete output (31 lines):
  Traceback (most recent call last):
    File "setup.py", line 214, in <module>
      do_setup(package_data)
    File "setup.py", line 136, in do_setup
      setup(
    File "/private/var/folders/_4/yxn93yzn14g0_0k2rmctcc1x8lvpn4/T/pip-build-env-gi7j5w4c/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 152, in setup
      _install_setup_requires(attrs)
    File "/private/var/folders/_4/yxn93yzn14g0_0k2rmctcc1x8lvpn4/T/pip-build-env-gi7j5w4c/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 147, in _install_setup_requires
      dist.fetch_build_eggs(dist.setup_requires)
    File "/private/var/folders/_4/yxn93yzn14g0_0k2rmctcc1x8lvpn4/T/pip-build-env-gi7j5w4c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 60, in fetch_build_eggs
      raise SetupRequirementsError(specifier_list)
  setuptools.build_meta.SetupRequirementsError: ['cython', 'numpy', 'setuptools>=18.0']

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/Users/louismartin/miniconda3/envs/dev3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/Users/louismartin/miniconda3/envs/dev3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/louismartin/miniconda3/envs/dev3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/private/var/folders/_4/yxn93yzn14g0_0k2rmctcc1x8lvpn4/T/pip-build-env-gi7j5w4c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 154, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "/private/var/folders/_4/yxn93yzn14g0_0k2rmctcc1x8lvpn4/T/pip-build-env-gi7j5w4c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 135, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/_4/yxn93yzn14g0_0k2rmctcc1x8lvpn4/T/pip-build-env-gi7j5w4c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 150, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 217, in <module>
      os.unlink(fairseq_examples)
  PermissionError: [Errno 1] Operation not permitted: 'fairseq/examples'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/02/59/1f466d82d64482e2809a167e0067979c23057b3752e668537d5ff24453c9/fairseq-0.10.2.tar.gz#sha256=45b90d8ccc3f5a4623a523fe2d0465f54413d03fd1ec9a9d7af0461148ca1a68 (from https://pypi.org/simple/fairseq/). Command errored out with exit status 1: /Users/louismartin/miniconda3/envs/dev3.9/bin/python /Users/louismartin/miniconda3/envs/dev3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/_4/yxn93yzn14g0_0k2rmctcc1x8lvpn4/T/tmpok_9kdi5 Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement fairseq==0.10.2
ERROR: No matching distribution found for fairseq==0.10.2

Seems to be due to this line

@louismartin
Copy link
Contributor Author

I reproduced the issue on ubuntu 20.04 with python 3.9

The error does not occur with ubuntu 20.04 and python 3.8 so it is probably due to python 3.9.

@louismartin louismartin changed the title Cannot install fairseq==0.10.2 with python 3.9 on macOS Cannot install fairseq==0.10.2 with python 3.9 May 5, 2021
@louismartin
Copy link
Contributor Author

Hi @myleott any news on when a new pip version will be released fixing compatibility for python 3.9?
I'm asking because I get issues on my repo about python 3.9 compatibility.

@leeway00
Copy link

It's not just a problem with python 3.9. It appears even for 3.8, 3.7, 3.6.

@jung-youjin
Copy link

jung-youjin commented Aug 5, 2021

Facing the same issue with python 3.6 . Any updates on this? @leeway00 @louismartin

@leeway00
Copy link

leeway00 commented Aug 5, 2021

Facing the same issue with python 3.6 . Any updates on this? @leeway00 @louismartin

I had a problem while using alpine image in Docker. I solved it by using torch image.

@jung-youjin
Copy link

Facing the same issue with python 3.6 . Any updates on this? @leeway00 @louismartin

저는 도커 alpine에서 돌리다 문제가 발생했었는데, torch 이미지로 도커파일 바꿔서 해결했어요.. 같은 상황이실지는 모르겠네요

Ah! I'm unfortunately in a different situation. I'm on conda env. Anyways, thank you for your help. :)

@kurtisxx
Copy link

kurtisxx commented Sep 13, 2021

Having the same issue. Would love to hear if you have any solution for this? @louismartin

@annagansen22
Copy link

Hi, I have the same issue and would love to hear any solutions! I am using Python 3.8 on Windows.

@0x1orz
Copy link

0x1orz commented Nov 3, 2021

Hi, with python=3.9 ,ubuntu=20.04 , the same issue informs and conda also failed to install -c conda-forge or search -c pytorch.

% pip install fairseq==0.10.2
Collecting fairseq==0.10.2
Downloading fairseq-0.10.2.tar.gz (938 kB)
|████████████████████████████████| 938 kB 268 kB/s
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /opt/envs/ml/bin/python3.9 /opt/envs/ml/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpi9h33vpp
cwd: /tmp/pip-install-580ty_am/fairseq_9a2162ba544347ea84244836281ffd3e
Complete output (33 lines):
/tmp/pip-build-env-bwv17z0g/overlay/lib/python3.9/site-packages/setuptools/init.py:148: SetuptoolsDeprecationWarning: setup_requires is deprecated. Supply build dependencies using PEP 517 pyproject.toml build-requires.
warnings.warn(
Traceback (most recent call last):
File "setup.py", line 214, in
do_setup(package_data)
File "setup.py", line 136, in do_setup
setup(
File "/tmp/pip-build-env-bwv17z0g/overlay/lib/python3.9/site-packages/setuptools/init.py", line 158, in setup
_install_setup_requires(attrs)
File "/tmp/pip-build-env-bwv17z0g/overlay/lib/python3.9/site-packages/setuptools/init.py", line 153, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/tmp/pip-build-env-bwv17z0g/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 60, in fetch_build_eggs
raise SetupRequirementsError(specifier_list)
setuptools.build_meta.SetupRequirementsError: ['cython', 'numpy', 'setuptools>=18.0']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/envs/ml/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
main()
File "/opt/envs/ml/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/opt/envs/ml/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-bwv17z0g/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 154, in get_requires_for_build_wheel
return self._get_build_requires(
File "/tmp/pip-build-env-bwv17z0g/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 135, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-bwv17z0g/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 150, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 217, in
os.unlink(fairseq_examples)
IsADirectoryError: [Errno 21] Is a directory: 'fairseq/examples'

WARNING: Discarding https://files.pythonhosted.org/packages/02/59/1f466d82d64482e2809a167e0067979c23057b3752e668537d5ff24453c9/fairseq-0.10.2.tar.gz#sha256=45b90d8ccc3f5a4623a523fe2d0465f54413d03fd1ec9a9d7af0461148ca1a68 (from https://pypi.org/simple/fairseq/). Command errored out with exit status 1: /opt/envs/ml/bin/python3.9 /opt/envs/ml/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpi9h33vpp Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement fairseq==0.10.2 (from versions: 0.6.1, 0.6.2, 0.7.1, 0.7.2, 0.8.0, 0.9.0, 0.10.0, 0.10.1, 0.10.2)
ERROR: No matching distribution found for fairseq==0.10.2

@brando90
Copy link

brando90 commented Dec 13, 2021

@Amiron49
Copy link

It's not just a problem with python 3.9. It appears even for 3.8, 3.7, 3.6.

I tried it with python 3.10.1 and 3.9.9 which yielded the same error as the OP. But going down to python 3.8.12 helped.

To be more precise this the dockerfile of the successful install:

FROM python:3.8.12-slim-bullseye
RUN apt-get -y update
RUN apt-get -y install build-essential=12.9
RUN pip3 install torch==1.10.1+cpu torchvision==0.11.2+cpu torchaudio==0.10.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
RUN pip install -Iv fairseq==0.10.2

@ftshijt
Copy link
Contributor

ftshijt commented Jan 31, 2022

The same issue is happening in our CI test. https://github.com/espnet/espnet/runs/5011281760?check_suite_focus=true But it's interesting that the issue just come out in a very recent time. It does not have the issue from the point when the issue is raised.

@MdYeasinSamadArnob
Copy link

Did you solved the problem ... I am facing the same problem. I passed 6 hours with this😔

@Darius-H
Copy link

Darius-H commented Mar 1, 2022

I met the same problem on Windows10 python3.9.7. Why this problem has not been tackled yet?

@sdvillal
Copy link

For conda users, there are a few open PRs aiming at fixing this. In particular this one seems to work.

Until they get accepted, a workaround is to use sdvillal::fairseq as a dependency in your environment (linux and macos only).

@bnika
Copy link

bnika commented Mar 22, 2022

For me (on MacOS 10.15, Python 3.9) the issue turned out to be the pip version: using pip 21.3.1 works fine but upgrading to pip 22.0.4 resulted in the above error

@krassowski
Copy link

pip 21.3.1 did not work for me the only thing it did differently was it persevered when installing 0.10.2 and 0.10.1 failed and ended up successfully installing 0.10.0.

@Camouflagee
Copy link

it does work on fairseq version:1.0.0, the solution is as follow:

git clone https://github.com/pytorch/fairseq
cd fairseq

activate env(that you created existed)
pip install --editable .

reference : https://stackoverflow.com/questions/65445611/cannot-install-fairseq-using-anaconda

@danjenson
Copy link

danjenson commented May 17, 2022

still getting this buggo with python 3.9.9 (pip 22.1) on Void Linux for fairseq versions 0.10.1 and 0.10.2, but was able to run pip install fairseq==0.10.0

@mrghofrani
Copy link

mrghofrani commented May 22, 2022

I was facing this issue on Google Colab; not on its default python version, which was 3.7.13 but on version 3.6.9. I had changed the python version via command sudo update-alternatives --config python3. Afterward, I needed to install and updated pip via the command sudo apt install python3-pip && python -m pip install --upgrade pip. The following is the error I was facing.

>>> pip install fairseq==0.9.0
Collecting fairseq==0.9.0
  Downloading fairseq-0.9.0.tar.gz (306 kB)
     |████████████████████████████████| 306 kB 4.7 MB/s            
  Preparing metadata (setup.py) ... error
WARNING: Discarding https://files.pythonhosted.org/packages/67/bf/de299e082e7af010d35162cb9a185dc6c17db71624590f2f379aeb2519ff/fairseq-0.9.0.tar.gz#sha256=61206358b79f325ea0b46cfd8c95cdb81bfbcfb43cf12b47d1d5124ce7321d3b (from https://pypi.org/simple/fairseq/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement fairseq==0.9.0 (from versions: 0.6.1, 0.6.2, 0.7.1, 0.7.2, 0.8.0, 0.9.0, 0.10.0, 0.10.1, 0.10.2)
ERROR: No matching distribution found for fairseq==0.9.0

Surprisingly error was resolved by updating setuptools via the command pip3 install --upgrade setuptools. This solution originally was suggested in here.

ramon-astudillo added a commit to IBM/transition-amr-parser that referenced this issue May 9, 2023
@theshypig
Copy link

still getting this buggo with python 3.9.9 (pip 22.1) on Void Linux for fairseq versions 0.10.1 and 0.10.2, but was able to run pip install fairseq==0.10.0

yes, it also works with python 3.10 on windows11.

@SharmaTushar007
Copy link

ERROR: Cannot install fairseq2==0.1.0 and fairseq2==0.1.1 because these package versions have conflicting dependencies.

@ruobingli1103
Copy link

I encountered the same issue while trying to install fairseq=0.10.2 using pip, and after several attempts that all ended in failure, I finally found a solution that worked for me (on Windows with Python 3.8).

Here's how I managed to install fairseq version 0.10.2:

1.You can download either the zip or tar.gz of the specific release directly from the https://github.com/facebookresearch/fairseq/releases/tag/v0.10.2
2.After downloading and extracting the file, I opened a command prompt with administrator privileges.
3.Navigated to the extracted fairseq directory: cd path\to\fairseq
4.pip install --editable ./

This method proved successful.

Please note that fairseq=0.10.2 requires PyTorch version >= 1.5.0 and Python version >= 3.6. Ensure these requirements are met prior to installation.

Hope this helps anyone else facing the same challenge!

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