解决方案:python3.8 安装transformer包时报错:Can not find Rust compiler

错误详情:

ERROR: Command errored out with exit status 1:
   command: '/Users/XXX/...' 
'/Users/XXX/..._in_process.py' build_wheel '/Users/XXX/...'
       cwd: /Users/XXX/.../pip-install-sza2_lmj\tokenizers
  Complete output (10 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  creating build\lib\tokenizers
  copying tokenizers\__init__.py -> build\lib\tokenizers
  running build_ext
  running build_rust
  error: Can not find Rust compiler
  ----------------------------------------
  ERROR: Failed building wheel for tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers which use PEP 517 and cannot be installed directly

解决方法:

1. 安装  Rust ,在终端中输入:

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

2. 重启终端

3. 再次安装transformers

pip install transformers

你可能感兴趣的:(bug,fix,python,自然语言处理,transformer)