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

我是第一种有效。

相关推荐
Zzz不能停28 分钟前
个人博客系统系统---测试报告【笔耕云】
python·功能测试·自动化·压力测试
互联网中的一颗神经元1 小时前
小白python入门 - 39. 采集流水线小项目
开发语言·python
Wang's Blog2 小时前
Go-Zero 项目开发22:用户群聊功能的实现与完善
开发语言·golang
a1117762 小时前
坦克大战3D Three.js 3D (开源项目)
开发语言·javascript·3d
郭老二2 小时前
【Python】常用模块:xmlrpc
python
名字还没想好☜3 小时前
Python itertools 实战:用 groupby、chain、islice 优雅处理大数据流
linux·windows·python·迭代器·itertools
Ivanqhz3 小时前
Rust &‘static str浅析
java·前端·javascript·rust
威联通网络存储3 小时前
TS-h2490FU在面板制造Array段AOI缺陷画廊中的并联
python·制造
Wang's Blog4 小时前
Go-Zero项目开发24: 基于Bitmap实现群聊消息已读未读
开发语言·后端·golang
接针4 小时前
UV 常用命令
python·uv