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

我是第一种有效。

相关推荐
南境十里·墨染春水13 小时前
C++ 工厂模式:从入门到进阶,彻底掌握对象创建的艺术
开发语言·c++·算法
某人辛木13 小时前
Web自动化测试
前端·python·pycharm·pytest
C+++Python13 小时前
详细介绍一下Java泛型的通配符
java·windows·python
红尘散仙14 小时前
别再手动录屏了:用 VHS 给终端应用生成会动的文档素材
后端·rust
JosieBook14 小时前
【数据库】时序预测能力的分级进化:TimechoAI如何让每一类用户都能精准预见未来
java·开发语言·数据库
加号314 小时前
【C#】 文件与目录管理:创建、删除操作的技术解析
开发语言·c#
小帅热爱难回头14 小时前
编写Skill生成AI落地项目系统架构
python
diving deep15 小时前
脚本速览-python
开发语言·python
一生了无挂15 小时前
Java处理JSON技巧教学(从基础到高阶实战全覆盖)
java·开发语言·json
swordbob15 小时前
Spring 单例 Bean 是线程安全的吗?
java·开发语言