安装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

我是第一种有效。

相关推荐
周不易6 分钟前
ubuntu20.04+qt5.12.8安装serialbus
开发语言·c++·qt·modbus·serialbus
嘤国大力士10 分钟前
C++11&QT复习 (十七)
开发语言·c++·qt
明月看潮生30 分钟前
青少年编程与数学 02-016 Python数据结构与算法 12课题、递归
python·算法·青少年编程·编程与数学
批量小王子36 分钟前
批量统一图像色彩
python
.格子衫.44 分钟前
008二分答案+贪心判断——算法备赛
开发语言·c++·算法
小蒜学长1 小时前
机动车号牌管理系统设计与实现(代码+数据库+LW)
开发语言·数据库·spring boot·后端·spring·oracle
自在如风。1 小时前
Java 设计模式:装饰者模式详解
java·python·设计模式
Pasregret1 小时前
11-Java并发编程终极指南:ThreadLocal与并发设计模式实战
java·开发语言·设计模式
大模型真好玩1 小时前
不写一行代码! VsCode+Cline+高德地图MCP Server 帮你搞定和女友的出行规划(附原理解析)
人工智能·python·mcp
再玩一会儿看代码1 小时前
pip 与 conda 的全面比较:Python 包管理的深度解析
经验分享·笔记·python·conda·课程设计·pip