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

我是第一种有效。

相关推荐
_Kayo_40 分钟前
JS深拷贝 浅拷贝、CSS垂直水平居中
开发语言·前端·javascript
云天徽上1 小时前
【数据可视化-87】2023-2024年中国各省人口变化深度分析与可视化:Python + pyecharts打造炫酷暗黑主题大屏
开发语言·python·信息可视化·数据可视化·pyecharts
404未精通的狗1 小时前
(C++)继承全解析及运用
开发语言·c++
李永奉1 小时前
C语言—数组和指针练习题合集(二)
c语言·开发语言
人工干智能1 小时前
游戏中角色持枪:玩家操控角色,角色转向时枪也要转向
python·游戏·pygame
C4程序员1 小时前
北京JAVA基础面试30天打卡08
java·开发语言·面试
桃源学社(接毕设)2 小时前
基于Django珠宝购物系统设计与实现(LW+源码+讲解+部署)
人工智能·后端·python·django·毕业设计
God-Hrh2 小时前
JVM运维
java·开发语言·jvm
weixin_448617052 小时前
疏老师-python训练营-Day43复习日
开发语言·python
xuejianxinokok2 小时前
解惑rust中的 Send/Sync(译)
后端·rust