google/cld3

Could not build wheels for gcld3, which is required to install pyproject.toml-based projects

Closed this issue · 5 comments

Hi!
I was trying to execute a colab notebook that I used a couple of months ago for a project using OpenNMT. When I tryed to run it, I got an error while installing the packages that stated :

error: subprocess-exited-with-error 
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for gcld3 (setup.py) ... error
  ERROR: Failed building wheel for gcld3
  Running setup.py clean for gcld3
Failed to build gcld3
ERROR: Could not build wheels for gcld3, which is required to install pyproject.toml-based projects

Is it due to the newer versions of some libraries introduced in the kernel of colab? I also tried installing pytorch 1.13 before running everything, but it gives the same message. I also tried to create a virtual env at the beginning of the colab runtime using !virtualenv exampleEnv and !source /content/theanoEnv/bin/activate; for executing the commands, but it doesn't work either way. Is there a way to make it work on google colab?

Thank you for your help!

P.S. Here follows a full log of the error
Code in the cell:

!git clone https://github.com/OpenNMT/OpenNMT-py.git
%cd OpenNMT-py
!pip3 install -e .

Full Error:

Cloning into 'OpenNMT-py'...
remote: Enumerating objects: 19686, done.
remote: Counting objects: 100% (534/534), done.
remote: Compressing objects: 100% (274/274), done.
remote: Total 19686 (delta 300), reused 437 (delta 245), pack-reused 19152
Receiving objects: 100% (19686/19686), 276.10 MiB | 15.96 MiB/s, done.
Resolving deltas: 100% (14216/14216), done.
/content/OpenNMT-py/OpenNMT-py/OpenNMT-py
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Obtaining file:///content/OpenNMT-py/OpenNMT-py/OpenNMT-py
  Preparing metadata (setup.py) ... done
Collecting torch<2,>=1.13 (from OpenNMT-py==3.1.2)
  Using cached torch-1.13.1-cp310-cp310-manylinux1_x86_64.whl (887.5 MB)
Collecting configargparse (from OpenNMT-py==3.1.2)
  Using cached ConfigArgParse-1.5.3-py3-none-any.whl (20 kB)
Collecting ctranslate2<4,>=3.2 (from OpenNMT-py==3.1.2)
  Using cached ctranslate2-3.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (32.0 MB)
Requirement already satisfied: tensorboard>=2.3 in /usr/local/lib/python3.10/dist-packages (from OpenNMT-py==3.1.2) (2.12.2)
Requirement already satisfied: flask in /usr/local/lib/python3.10/dist-packages (from OpenNMT-py==3.1.2) (2.2.4)
Collecting waitress (from OpenNMT-py==3.1.2)
  Using cached waitress-2.1.2-py3-none-any.whl (57 kB)
Collecting pyonmttok<2,>=1.35 (from OpenNMT-py==3.1.2)
  Using cached pyonmttok-1.37.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.0 MB)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from OpenNMT-py==3.1.2) (6.0)
Collecting sacrebleu (from OpenNMT-py==3.1.2)
  Using cached sacrebleu-2.3.1-py3-none-any.whl (118 kB)
Collecting rapidfuzz (from OpenNMT-py==3.1.2)
  Using cached rapidfuzz-3.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB)
Collecting pyahocorasick (from OpenNMT-py==3.1.2)
  Using cached pyahocorasick-2.0.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (110 kB)
Collecting gcld3 (from OpenNMT-py==3.1.2)
  Using cached gcld3-3.0.13.tar.gz (647 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from ctranslate2<4,>=3.2->OpenNMT-py==3.1.2) (1.22.4)
Requirement already satisfied: absl-py>=0.4 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (1.4.0)
Requirement already satisfied: grpcio>=1.48.2 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (1.54.0)
Requirement already satisfied: google-auth<3,>=1.6.3 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (2.17.3)
Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (1.0.0)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (3.4.3)
Requirement already satisfied: protobuf>=3.19.6 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (3.20.3)
Requirement already satisfied: requests<3,>=2.21.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (2.27.1)
Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (67.7.2)
Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (0.7.0)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (1.8.1)
Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (2.3.0)
Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.10/dist-packages (from tensorboard>=2.3->OpenNMT-py==3.1.2) (0.40.0)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch<2,>=1.13->OpenNMT-py==3.1.2) (4.5.0)
Collecting nvidia-cuda-runtime-cu11==11.7.99 (from torch<2,>=1.13->OpenNMT-py==3.1.2)
  Using cached nvidia_cuda_runtime_cu11-11.7.99-py3-none-manylinux1_x86_64.whl (849 kB)
Collecting nvidia-cudnn-cu11==8.5.0.96 (from torch<2,>=1.13->OpenNMT-py==3.1.2)
  Using cached nvidia_cudnn_cu11-8.5.0.96-2-py3-none-manylinux1_x86_64.whl (557.1 MB)
Collecting nvidia-cublas-cu11==11.10.3.66 (from torch<2,>=1.13->OpenNMT-py==3.1.2)
  Using cached nvidia_cublas_cu11-11.10.3.66-py3-none-manylinux1_x86_64.whl (317.1 MB)
Collecting nvidia-cuda-nvrtc-cu11==11.7.99 (from torch<2,>=1.13->OpenNMT-py==3.1.2)
  Using cached nvidia_cuda_nvrtc_cu11-11.7.99-2-py3-none-manylinux1_x86_64.whl (21.0 MB)
Requirement already satisfied: Jinja2>=3.0 in /usr/local/lib/python3.10/dist-packages (from flask->OpenNMT-py==3.1.2) (3.1.2)
Requirement already satisfied: itsdangerous>=2.0 in /usr/local/lib/python3.10/dist-packages (from flask->OpenNMT-py==3.1.2) (2.1.2)
Requirement already satisfied: click>=8.0 in /usr/local/lib/python3.10/dist-packages (from flask->OpenNMT-py==3.1.2) (8.1.3)
Collecting portalocker (from sacrebleu->OpenNMT-py==3.1.2)
  Using cached portalocker-2.7.0-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: regex in /usr/local/lib/python3.10/dist-packages (from sacrebleu->OpenNMT-py==3.1.2) (2022.10.31)
Requirement already satisfied: tabulate>=0.8.9 in /usr/local/lib/python3.10/dist-packages (from sacrebleu->OpenNMT-py==3.1.2) (0.8.10)
Collecting colorama (from sacrebleu->OpenNMT-py==3.1.2)
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Requirement already satisfied: lxml in /usr/local/lib/python3.10/dist-packages (from sacrebleu->OpenNMT-py==3.1.2) (4.9.2)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.3->OpenNMT-py==3.1.2) (5.3.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.3->OpenNMT-py==3.1.2) (0.3.0)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.3->OpenNMT-py==3.1.2) (1.16.0)
Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.10/dist-packages (from google-auth<3,>=1.6.3->tensorboard>=2.3->OpenNMT-py==3.1.2) (4.9)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.3->OpenNMT-py==3.1.2) (1.3.1)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from Jinja2>=3.0->flask->OpenNMT-py==3.1.2) (2.1.2)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.21.0->tensorboard>=2.3->OpenNMT-py==3.1.2) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.21.0->tensorboard>=2.3->OpenNMT-py==3.1.2) (2022.12.7)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.21.0->tensorboard>=2.3->OpenNMT-py==3.1.2) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.21.0->tensorboard>=2.3->OpenNMT-py==3.1.2) (3.4)
Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /usr/local/lib/python3.10/dist-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard>=2.3->OpenNMT-py==3.1.2) (0.5.0)
Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard>=2.3->OpenNMT-py==3.1.2) (3.2.2)
Building wheels for collected packages: gcld3
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for gcld3 (setup.py) ... error
  ERROR: Failed building wheel for gcld3
  Running setup.py clean for gcld3
Failed to build gcld3
ERROR: Could not build wheels for gcld3, which is required to install pyproject.toml-based projects

Same error. But not on google colab. I am using paperspace gradient.

Paperspace Gradient customer support provided a solution. Please use the following command before installing OpenNMT.
!sudo apt-get update && yes | sudo apt install protobuf-compiler . I hope it will work. Good luck!

Still failed to compile with the same error :( but thanks for the answer! :)

I came across the same problem. Is there any solution?

If the problem is due to the usage of OpenNMT, I wrote an issure on their github and they fixed it by replacing the gcld3 library with FastText. Then you just need to install an older version of pytorch on the current colab kernel and the issue is gone when installing OpenNMT. Don't know about other libraries using gcld3 tho.