Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't find Rust compiler to install transformers

Tags:

windows

rust

I don't know how to fix this error (for pip install transformer on windows): 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

also tried this:

git clone https://github.com/huggingface/transformers.git 
cd transformers
pip install -e .

and when I install rust it doesn't work either.

like image 547
Carmen Appelt Avatar asked Dec 17 '25 17:12

Carmen Appelt


2 Answers

You need to install Rust before installing transformers.

The standard way to install (from the rust documentation) is

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

On windows you can use alternative methods:

  • rustup-init.exe
  • standalone installers
  • Chocolatey or Scoop

Sometimes it's useful to use default answers to the installation script:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
like image 163
Guglie Avatar answered Dec 20 '25 08:12

Guglie


I also faced the issue that continued also after I installed rustup with the above suggestions. Using the [Sentiment Analysis with Hugging transformer][1] I found the following pip command to install transformers:

pip install transformers==4.6.1

setting the transformers version to install the relative installation it completed without any further issues. I hope that this can help someone else to save installation time... [1]: https://python.plainenglish.io/sentiment-analysis-in-python-with-3-lines-of-code-9382a649c23d

like image 39
OPMendeavor Avatar answered Dec 20 '25 07:12

OPMendeavor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!