ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based...

本是古典 何须时尚 2023-09-25 14:56 122阅读 0赞
  1. error: can't find Rust compiler
  2. 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.
  3. To update pip, run:
  4. pip install --upgrade pip
  5. and then retry package installation.
  6. 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.
  7. [end of output]
  8. note: This error originates from a subprocess, and is likely not a problem with pip.
  9. ERROR: Failed building wheel for tokenizers
  10. Failed to build tokenizers
  11. ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

问题描述:

当我下载transformers/spacy库的时候报了如上的错误。

解决办法:

1.安装Rust
(1)使用命令

  1. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

(2)选择默认安装

  1. 1) Proceed with installation (default)
  2. 2) Customize installation
  3. 3) Cancel installation
  4. >1

(3)安装完成,使用命令查看Rust版本

  1. rustc --version

2.pip3 install tranformers==x.x.x

(x.x.x为版本号)

PS_1:若Rust版本查看不了,则使用如下命令或查看官网

  1. source $HOME/.cargo/env

PS_2:若pip install报错,可以尝试修改python版本(我原来是3.9,换成3.8之后成功运行)

ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based…_JOJO黄金之风的博客-CSDN博客

发表评论

表情:
评论列表 (有 0 条评论,122人围观)

还没有评论,来说两句吧...

相关阅读