gpt4 book ai didi

python - VS Code 中未安装 HuggingFace 变形金刚

转载 作者:行者123 更新时间:2023-12-05 04:38:25 24 4
gpt4 key购买 nike

我是 VS 代码和一般编码方面的新手,我一直在尝试使用命令 pip install tr​​ansformerspip install tr​​ansformers[tf-cpu]< 安装转换器 两者均无效,出现以下错误:

Building wheel for tokenizers (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\TevaJ\Desktop\Projects\venv\Scripts\python.exe' 'C:\Users\TevaJ\Desktop\Projects\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\TevaJ\AppData\Local\Temp\tmps54vamjd'
cwd: C:\Users\TevaJ\AppData\Local\Temp\pip-install-kolpujzg\tokenizers_befed87ed1a749f8a23369cfa56db8a2
Complete output (19 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\tokenizers
copying tokenizers\__init__.py -> build\lib.win-amd64-3.10\tokenizers
running build_ext
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.
----------------------------------------
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
(venv) PS C:\Users\TevaJ\Desktop\Projects>

我在 google 上查找,但找不到解决方案。有谁知道这个错误以及如何解决它?

最佳答案

已解决。

只需从源代码安装它而不依赖于 PIP 619。

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

关于python - VS Code 中未安装 HuggingFace 变形金刚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70608245/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com