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

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 tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

问题描述:

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

解决办法:

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

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

(2)选择默认安装

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

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

rustc --version

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

(x.x.x为版本号)

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

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博客 

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
引用[1]:ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based..._JOJO黄金之风的博客-CSDN博客。 引用[2]:经历:安装完OpenCV后在import cv2时报错ImportError: numpy.core.multiarray failed to import, 网上查出方案是numpy版本不适配,我就卸载重新安装了。(pip uninstall如果报错权限不够,就在前面加上sudo)但安装一直报错Could not build wheels for numpy,which is required to install pyproject.toml-based projects (不论是换哪个源都是这样) 。 引用[3]: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 tokenizers Failed to build tokenizers ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects 回答: 这个错误提示表明在安装nnunet时无法构建wheels,而这是安装pyproject.toml-based项目所需的。[1]这个问题可能是由于缺少一些依赖或者环境配置不正确导致的。有几种可能的解决方案可以尝试。首先,你可以尝试更新pip,运行命令pip install --upgrade pip,然后重新尝试安装nnunet。[3]另外,你还可以尝试安装Rust编译器,可以从系统包管理器中安装,确保它在安装过程中的PATH环境变量中。或者,你也可以使用rustup(https://rustup.rs)来下载和更新Rust编译器工具链。[3]此外,你还可以检查是否缺少其他依赖项,例如numpy,如果是的话,可以尝试重新安装它。[2]如果以上方法都没有解决问题,你可以尝试在相关的论坛或社区寻求帮助,以获取更具体的解决方案。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值