pip install transformers
出现失败:
subprocess.CalledProcessError: Command '['./build_bundled.sh', '0.1.97']' returned non-zero exit status 1
看到文章 https://blog.csdn.net/caroline_wendy/article/details/109337216 ,需要手动下载安装。
到 https://pypi.org/project/sentencepiece/0.1.96/#files 里下载
再次失败
ERROR: sentencepiece-0.1.97-cp310-cp310-macosx_10_9_x86_64.whl is not a supported wheel on this platform.
https://wonius.top/2022/05/02/macOS%E5%AE%89%E8%A3%85sentencepiece%E6%A8%A1%E5%9D%97%E5%A4%B1%E8%B4%A5/ 发现是因为版本下载错误导致,
https://pypi.tuna.tsinghua.edu.cn/simple/sentencepiece/ 到这里找到正确的 python版本,
重新安装 sentencepiece:
sudo pip install --user sentencepiece-0.1.92-cp27-cp27m-macosx_10_6_x86_64.whl
最后再安装 transformers
pip install transformers