安装transformers报错error can‘t find rust compiler

重装系统后安装transformers遇到bug,记录一下,方面以后查看。

Windows下使用pip install transformers命令重新安装时,却报错:

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

根据错误提示,首先运行pip install --upgrade pip无效,然后便根据错误的提示需要安装Rust Compiler,首先去其官网下载相应的安装包,根据本人的实际情况选择64位的安装文件,然后点击下载的exe文件进行安装,安装过程中选择默认(default)配置即可。

根据官网的说明Rust所有的工具都在~/.cargo/bin目录,包括rustccargorustup命令,因此需要将其配置到环境变量中,但Windows会进行自动配置,但是配置的环境变量在Windows下需要重启电脑才会生效。在重启后,再次运行安装命令:

pip install transformers

结果是安装成功,截图如下:

outcome

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

斯曦巍峨

码文不易,有条件的可以支持一下

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值