@wesqyy

Ошибка при импорта библиотеки?

Хочу сделать аи бота просто для прикола pip install transformers ошибка -
spoiler
/storage/emulated/0 
  Obtaining dependency information for transformers from https://files.pythonhosted.org/packages/21/02/ae8e595f45b6c8edee07913892b3b41f5f5f273962ad98851dc6a564bbb9/transformers-4.31.0-py3-none-any.whl.metadata
  Using cached transformers-4.31.0-py3-none-any.whl.metadata (116 kB)
Collecting filelock (from transformers)
  Obtaining dependency information for filelock from https://files.pythonhosted.org/packages/00/45/ec3407adf6f6b5bf867a4462b2b0af27597a26bd3cd6e2534cb6ab029938/filelock-3.12.2-py3-none-any.whl.metadata  Using cached filelock-3.12.2-py3-none-any.whl.metadata (2.7 kB)
Collecting huggingface-hub<1.0,>=0.14.1 (from transformers)
  Obtaining dependency information for huggingface-hub<1.0,>=0.14.1 from .16.4-py3-none-any.whl.metadata
  Using cached huggingface_hub-0.16.4-py3-none-any.whl.metadata (12 kB)
Requirement already satisfied: numpy>=1.17 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from transformers) (1.21.2)
Requirement already satisfied: packaging>=20.0 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from transformers) (21.0)
Requirement already satisfied: pyyaml>=5.1 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from transformers) (5.4.1)
Collecting regex!=2019.12.17 (from transformers)
  Using cached regex-2023.6.3-cp39-cp39-linux_aarch64.whl
Requirement already satisfied: requests in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from transformers) (2.31.0)
Collecting tokenizers!=0.11.3,<0.14,>=0.11.1 (from transformers)
  Using cached tokenizers-0.13.3.tar.gz (314 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting safetensors>=0.3.1 (from transformers)
  Using cached safetensors-0.3.1.tar.gz (34 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: tqdm>=4.27 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from transformers) (4.65.0)
Collecting fsspec (from huggingface-hub<1.0,>=0.14.1->transformers)  Obtaining dependency information for fsspec from https://files.pythonhosted.org/packages/e3/bd/4c0a4619494188a9db5d77e2100ab7d544a42e76b2447869d8e124e981d8/fsspec-2023.6.0-py3-none-any.whl.metadata
  Using cached fsspec-2023.6.0-py3-none-any.whl.metadata (6.7 kB)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from huggingface-hub<1.0,>=0.14.1->transformers) (3.10.0.2)
Requirement already satisfied: pyparsing>=2.0.2 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from packaging>=20.0->transformers) (2.4.7)
Requirement already satisfied: charset-normalizer<4,>=2 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from requests->transformers) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from requests->transformers) (2.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from requests->transformers) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages (from requests->transformers) (2023.5.7)
Using cached transformers-4.31.0-py3-none-any.whl (7.4 MB)
Using cached huggingface_hub-0.16.4-py3-none-any.whl (268 kB)
Using cached filelock-3.12.2-py3-none-any.whl (10 kB)
Using cached fsspec-2023.6.0-py3-none-any.whl (163 kB)
Building wheels for collected packages: safetensors, tokenizers
  Building wheel for safetensors (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for safetensors (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-39
      creating build/lib.linux-aarch64-cpython-39/safetensors
      copying py_src/safetensors/__init__.py -> build/lib.linux-aarch64-cpython-39/safetensors
      copying py_src/safetensors/flax.py -> build/lib.linux-aarch64-cpython-39/safetensors
      copying py_src/safetensors/numpy.py -> build/lib.linux-aarch64-cpython-39/safetensors
      copying py_src/safetensors/paddle.py -> build/lib.linux-aarch64-cpython-39/safetensors
      copying py_src/safetensors/tensorflow.py -> build/lib.linux-aarch64-cpython-39/safetensors
      copying py_src/safetensors/torch.py -> build/lib.linux-aarch64-cpython-39/safetensors
      running build_ext
      running build_rust
      error: can't find Rust compiler

      If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

      To update pip, run:

          pip install --upgrade pip

      and then retry package installation.

      If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for safetensors
  Building wheel for tokenizers (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for tokenizers (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [51 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
  ERROR: Failed building wheel for tokenizers
Failed to build safetensors tokenizers
ERROR: Could not build wheels for safetensors, tokenizers, which is required to install pyproject.toml-based projects

Что делать? Я делал pip install pip
  • Вопрос задан
  • 373 просмотра
Пригласить эксперта
Ответы на вопрос 1
fenrir1121
@fenrir1121
Начни с документации
Просто по приколу изучить язык прежде чем что-то делать.
Просто по приколу не пытаться программировать на телефоне.
Просто по приколу перевести ошибку.
Причина и инструкция что нужно делать чёрным по белому написаны в ошибке:
error: can't find Rust compiler

If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain


Кроме того прочитайте правила ресурса и оформите вопрос как положено: удалите теги, дискорд не имеет отношения к вашему вопросу, замените сложность и уберите портянку под спойлер
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы