1、使用pip
命令:安装之前先安装 tensorflow 2.x 版本 或 pytorch
pip install transformers==2.4.1
2、使用 Hugging Face github 官方
Since Transformers version v4.0.0, we now have a conda channel: huggingface.
🤗 Transformers can be installed using conda as follows:
conda install -c huggingface transformers
Follow the installation pages of Flax, PyTorch or TensorFlow to see how to install them with conda.