安装transforers时报错:error: can‘t find Rust compiler

报错:

复制代码
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

error: can't find Rust compiler

.......

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

方法:

复制代码
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
info: downloading installer

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

然后重新打开终端

最后重新安装transformer

复制代码
pip install transformers==4.15.0

我是第一种有效。

相关推荐
天马行空-4 分钟前
ES 精准匹配 和 模糊查询的实现方式
java·开发语言
深度学习lover10 分钟前
<项目代码>yolo遥感航拍船舶识别<目标检测>
人工智能·python·yolo·目标检测·计算机视觉·遥感船舶识别
Z***258013 分钟前
Java计算机视觉
java·开发语言·计算机视觉
Tiger_shl20 分钟前
SqlConnection、SqlCommand 和 SqlDataAdapter
开发语言·数据库·c#
一点事21 分钟前
ruoyi:集成mybatisplus实现mybatis增强
java·开发语言·mybatis
你的冰西瓜27 分钟前
C++14 新特性详解:相较于 C++11 的主要改进
开发语言·c++·stl
linksinke28 分钟前
Mapstruct引发的 Caused by: java.lang.NumberFormatException: For input string: ““
java·开发语言·exception·mapstruct·numberformat·不能为空
无限进步_34 分钟前
C语言单向链表实现详解:从基础操作到完整测试
c语言·开发语言·数据结构·c++·算法·链表·visual studio
8***B1 小时前
Python机器学习库Scikit-learn使用
python·机器学习·scikit-learn
好好研究1 小时前
SpringMVC框架 - 异常处理
java·开发语言·spring·mvc