fairseq install error
Hello, I met a error when I trying to install fairseq with cmd pip3 install --editable ./" the error message like below: `Getting requirements to build editable ... error error: subprocess-exited-with-error
× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
Traceback (most recent call last):
File "/home/likai/miniconda3/envs/fairseq/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error `
Environment
- fairseq Version (e.g., 1.0 or main):
- PyTorch Version: 1.10.1+cu111
- OS (e.g., Linux): Linux
- How you installed fairseq (
pip, source): - Build command you used (if compiling from source): pip3 install --editable ./
- Python version: python3.8.13
- CUDA/cuDNN version: cuda11.1
- GPU models and configuration: A100
Same problems, with Environment
- PyTorch Version: 1.12.1+cu113
- OS (e.g., Linux): Linux
- How you installed fairseq (pip, source):
- Build command you used (if compiling from source): pip3 install --editable ./
- Python version: python3.8.13
- CUDA/cuDNN version: cuda11.3
- GPU models and configuration: GeForce GTX 1080 Ti
Solved, anyone with same problem can try with the pip flag --no-build-isolation see https://lightrun.com/answers/h5py-h5py-source-build-can-only-find-system-installation-of-cython-not---user-or-venv
In my situation, it seems that due to environment setting or other things, pip install --editable uses exactly the system settings and not my conda environment, so it continuely uses the system environment and enhence can't find the cuda dll or other things to build ...(and take a long time to download dependecies)
Thank you @Labyrintbs. you have saved my day.
I had the same problem, running on Linux server. Whenever I tried to install fairseq I got Failed building wheel for fairseq.
Aparently, the problem was in C++ compiler. Follow steps below, if you have Linux, you will just need to install g++:
- Install / Update packages
sudo apt update && sudo apt install build-essential - Check list of available g++
apt search '^g\+\+-[0-9]+$' - Install at least version 12 or later from the list of available versions
sudo apt install g++-12
PS: Here are error logs I used to get before this solution
pip install fairseq
....
gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/conda/include -fPIC -O2 -isystem /opt/conda/include -fPIC -I/opt/conda/include/python3.10 -c fairseq/clib/libbleu/libbleu.cpp -o build/temp.linux-x86_64-cpython-310/fairseq/clib/libbleu/libbleu.o -std=c++11 -O3
error: command 'gcc' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for fairseq
Building wheel for antlr4-python3-runtime (setup.py) ... done
Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.8-py3-none-any.whl size=141209 sha256=5f5d56effcc196ca1d5eb3fe94da5ead9ba550f6e5bf9d4f29b7454f624705fe
Stored in directory: /root/.cache/pip/wheels/a7/20/bd/e1477d664f22d99989fd28ee1a43d6633dddb5cb9e801350d5
Successfully built antlr4-python3-runtime
Failed to build fairseq
ERROR: Could not build wheels for fairseq, which is required to install pyproject.toml-based projects
我在 Linux 服务器上运行时遇到了同样的问题。每当我尝试安装时,我都会得到.当然,问题出在C++编译器中。请按照以下步骤操作,如果您使用的是 Linux,则只需安装 g++:
fairseq``Failed building wheel for fairseq
- 安装/更新软件包
sudo apt update && sudo apt install build-essential- 检查可用 g++ 的列表
apt search '^g\+\+-[0-9]+$'- 从可用版本列表中至少安装版本 12 或更高版本
sudo apt install g++-12PS:这是我在此解决方案之前曾经获得的错误日志
pip install fairseq .... gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/conda/include -fPIC -O2 -isystem /opt/conda/include -fPIC -I/opt/conda/include/python3.10 -c fairseq/clib/libbleu/libbleu.cpp -o build/temp.linux-x86_64-cpython-310/fairseq/clib/libbleu/libbleu.o -std=c++11 -O3 error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for fairseq Building wheel for antlr4-python3-runtime (setup.py) ... done Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.8-py3-none-any.whl size=141209 sha256=5f5d56effcc196ca1d5eb3fe94da5ead9ba550f6e5bf9d4f29b7454f624705fe Stored in directory: /root/.cache/pip/wheels/a7/20/bd/e1477d664f22d99989fd28ee1a43d6633dddb5cb9e801350d5 Successfully built antlr4-python3-runtime Failed to build fairseq ERROR: Could not build wheels for fairseq, which is required to install pyproject.toml-based projects
我在linux服务器上遇到了和您之前相同的问题,“ERROR: Could not build wheels for fairseq, which is required to install pyproject.toml-based projects”,请问您可以详细说一下,如何安装“g++:fairseqFailed building wheel for fairseq”吗,我对这里并不了解,十分感谢,
Find a way to update gcc and g++ to version 9 and above
我在 Linux 服务器上运行时遇到了同样的问题。每当我尝试安装时,我都会得到.当然,问题出在C++编译器中。请按照以下步骤操作,如果您使用的是 Linux,则只需安装 g++:
fairseqFailed building wheel for fairseq ``
- 安装/更新软件包
sudo apt update && sudo apt install build-essential- 检查可用 g++ 的列表
apt search '^g\+\+-[0-9]+$'- 从可用版本列表中至少安装版本 12 或更高版本
sudo apt install g++-12PS:这是我在此解决方案之前曾经获得的错误日志
pip install fairseq .... gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/conda/include -fPIC -O2 -isystem /opt/conda/include -fPIC -I/opt/conda/include/python3.10 -c fairseq/clib/libbleu/libbleu.cpp -o build/temp.linux-x86_64-cpython-310/fairseq/clib/libbleu/libbleu.o -std=c++11 -O3 error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for fairseq Building wheel for antlr4-python3-runtime (setup.py) ... done Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.8-py3-none-any.whl size=141209 sha256=5f5d56effcc196ca1d5eb3fe94da5ead9ba550f6e5bf9d4f29b7454f624705fe Stored in directory: /root/.cache/pip/wheels/a7/20/bd/e1477d664f22d99989fd28ee1a43d6633dddb5cb9e801350d5 Successfully built antlr4-python3-runtime Failed to build fairseq ERROR: Could not build wheels for fairseq, which is required to install pyproject.toml-based projects我在linux服务器上遇到了和您之前相同的问题,“ERROR: Could not build wheels for fairseq, which is required to install pyproject.toml-based projects”,请问您可以详细说一下,如何安装“g++:fairseqFailed building wheel for fairseq”吗,我对这里并不了解,十分感谢,