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

我是第一种有效。

相关推荐
SteveKenny1 小时前
Python 梯度下降法(六):Nadam Optimize
开发语言·python
Hello.Reader2 小时前
深入浅出 Rust 的强大 match 表达式
开发语言·后端·rust
dreadp3 小时前
解锁豆瓣高清海报(二) 使用 OpenCV 拼接和压缩
图像处理·python·opencv·计算机视觉·数据分析
Tester_孙大壮3 小时前
第32章 测试驱动开发(TDD)的原理、实践、关联与争议(Python 版)
驱动开发·python·tdd
xrgs_shz4 小时前
MATLAB的数据类型和各类数据类型转化示例
开发语言·数据结构·matlab
小王子10246 小时前
设计模式Python版 组合模式
python·设计模式·组合模式
来恩10037 小时前
C# 类与对象详解
开发语言·c#
komo莫莫da7 小时前
寒假刷题Day19
java·开发语言
ElseWhereR8 小时前
C++ 写一个简单的加减法计算器
开发语言·c++·算法