nlp-with-transformers / notebooks

Jupyter notebooks for the Natural Language Processing with Transformers book
https://transformersbook.com/
Apache License 2.0
3.85k stars 1.19k forks source link

Error in notebook initialization #101

Open d-yoshioka093 opened 1 year ago

d-yoshioka093 commented 1 year ago

Information

I'm having trouble using this notebook for my learning and it's causing me inconvenience 😢 In the first line of XX_XXXX.ipynb, an error occurs when the following process is executed.

Describe the bug

code:

!git clone https://github.com/nlp-with-transformers/notebooks.git
%cd notebooks
from install import *
install_requirements()

Error details:

remote: Enumerating objects: 515, done.
remote: Counting objects: 100% (161/161), done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 515 (delta 139), reused 126 (delta 122), pack-reused 354
Receiving objects: 100% (515/515), 28.61 MiB | 19.59 MiB/s, done.
Resolving deltas: 100% (246/246), done.
/content/notebooks
⏳ Installing base requirements ...
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-1-86579c675642> in <cell line: 5>()
      3 get_ipython().run_line_magic('cd', 'notebooks')
      4 from install import *
----> 5 install_requirements()

/content/notebooks/install.py in install_requirements(is_chapter2, is_chapter6, is_chapter7, is_chapter7_v2, is_chapter10, is_chapter11)
     29     process_install = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     30     if process_install.returncode != 0:
---> 31         raise Exception("😭 Failed to install base requirements")
     32     else:
     33         print("✅ Base requirements installed!")

Exception: 😭 Failed to install base requirements

Environment:

Google Colaboratory Kaggle

I believe the error is caused during the installation of tokenizers from requirements.txt. However, I am using this notebook for my learning and it's causing me inconvenience 😢

!pip install tokenizers==0.10.3


Collecting tokenizers==0.10.3
  Downloading tokenizers-0.10.3.tar.gz (212 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 212.7/212.7 kB 17.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: tokenizers
  error: subprocess-exited-with-error

  × Building wheel for tokenizers (pyproject.toml) 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 tokenizers (pyproject.toml) ... error
  ERROR: Failed building wheel for tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects```
vaxherra commented 1 year ago

96 is related. What works is to install the Rust compiler.

Add a line to the first notebook cell:

!apt install cargo -y
(...)
d-yoshioka093 commented 1 year ago

Thanks for the answer. However, I am still getting the same error output. Is there any other work that needs to be done besides adding it to the first line?

image