当前位置:   article > 正文

解决transformers安装出错build tokenizers_building wheels for collected packages: tokenizers

building wheels for collected packages: tokenizers building wheel for tokeni

我的电脑之前应该是在官网下载python安装的,用transformers没有什么问题,然后重装系统后,我是直接在微软商店安装了python,结果就死活装不上transformers了,一直报什么ERROR: build wheel for tokenizers...类似下面这样:

  1. Building wheels for collected packages: tokenizers
  2. error: subprocess-exited-with-error
  3. × Building wheel for tokenizers (pyproject.toml) did not run successfully.
  4. exit code: 1
  5. ╰─> See above for output.
  6. note: This error originates from a subprocess, and is likely not a problem with pip.
  7. Building wheel for tokenizers (pyproject.toml) ... error
  8. ERROR: Failed building wheel for tokenizers
  9. Failed to build tokenizers
  10. ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

 试了网上说的几种方法,都不行:

  1. 升级pip, setuptool
  2. 安装pyproject
  3. 安装rust
  4. 修改transformers/setup.py中的tokenizers版本要求
  5. 安装低版本的transformers

直到出现了下面这个错误:                          

  1. ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\\Users\\ysr21\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python312\\site-packages\\transformers\\models\\deprecated\\trajectory_transformer\\convert_trajectory_transformer_original_pytorch_checkpoint_to_pytorch.py'
  2. HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths

提示:由于此系统未启用 Windows 长路径支持,因此可能发生了此错误。您可以在 https://pip.pypa.io/warnings/enable-long-paths 找到有关如何启用此功能的信息

这是由于微软商店把python安装在了一个很奇怪的长路径'C:\\Users\\ysr21\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python312‘

卸载python, 去官网重新安装python就好了,transformers也能顺利装上了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/946913
推荐阅读
相关标签
  

闽ICP备14008679号