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

我是第一种有效。

相关推荐
前进的李工5 分钟前
LangChain使用之Model IO(提示词模版之FewShotPromptTemplate)
开发语言·人工智能·语言模型·langchain·agent
Ivanqhz5 分钟前
寄存器分配的核心函数 allocate
java·开发语言·后端·python·rust
天远云服7 分钟前
驾培系统车辆核验实战:PHP集成天远二手车估值API实现学员车辆信息自动化管理
大数据·开发语言·自动化·php
2501_945424807 分钟前
高性能计算资源调度
开发语言·c++·算法
野犬寒鸦10 分钟前
JVM垃圾回收机制深度解析(G1篇)(垃圾回收过程及专业名词详解)(补充)
java·服务器·开发语言·jvm·后端·面试
ZHOUPUYU11 分钟前
PHP异步编程实战ReactPHP到Swoole的现代方案
开发语言·php
2501_9454235413 分钟前
如何为开源Python项目做贡献?
jvm·数据库·python
全栈凯哥13 分钟前
23.Python 魔术方法完全指南
python
2401_8845632415 分钟前
使用Flask快速搭建轻量级Web应用
jvm·数据库·python
2301_7765087215 分钟前
C++中的组合模式变体
开发语言·c++·算法