安装Transformers库用来调取最新的深度学习模型(NLP)

安装时报错:

 ERROR: Command errored out with exit status 1: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 pipand 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.----------------------------------------

按提示进行更新:pip install --upgrade pip,但是没有效果,显示Requirement already satisfied

按照提示安装rustup,安装后新的报错出现了:

 error: linker `link.exe` not found|= note: program not foundnote: the msvc targets depend on the msvc linker but `link.exe` was not foundnote: please ensure that VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 was installed with the Visual C++ option

提示说没有微软MS VC++编译环境的链接程序linker.exe,需要 VS 2013, VS 2015, VS 2017 or VS 2019或其他版本的VC++编译器,看了网上的解决方案,安装了Visual Studio 2019 生成工具Visual Studio 2019 build tools,下载build tools之后,在Visual studio installer中只选择“C++生成工具”,然后只选择"MSVC v142 - VS2019 C++ x64/x86 生成工具"

注意要在VS中登录一下微软账号,否则依然会报错。

解决了这一难题后,新的报错再次出现

warning: spurious network error (2 tries remaining): failed to send request: 鎿嶄綔瓒呮椂
; class=Os (2)
warning: spurious network error (1 tries remaining): failed to send request: 鎿嶄綔瓒呮椂
; class=Os (2)
error: failed to get `env_logger` as a dependency of package `tokenizers-python v0.11.0

尝试了三种方法,第一种删掉了~/.cargo/registry/index,第二种直接输入命令

 rustup toolchain install stable-x86_64-pc-windows-gnurustup default stable-x86_64-pc-windows-gnu

但是两种方法都无效,仍然提示linker `link.exe` not found,因此尝试了第三种方法

之前安装是只安装了"MSVC v142 - VS2019 C++ x64/x86 生成工具",这一次把下面两项也安装上了,Windows 10 SDK应该是必须要安装的

好,这个问题终于解决了,下面来到了本次任务的终极问题——

ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot
accurately determine which files belong to it which would lead to only a partial uninstall.

提示说环境中已经存在某个版本的PyYAML,因此需要重新安装PyYAML,输入指令pip install PyYAML --ignore-installed,然后再重新安装一次Transformers,成功啦!!

Transformers库安装报错相关推荐

  1. Python之Datasets库安装报错的解决方法

    Python之Datasets库安装报错的解决方法 Problem 想要run一下最近在看的有关Domain Adaptation的论文实现代码,文中使用了Datasets库,习惯性使用Anacond ...

  2. GO库安装报错解决:unrecognized import path golang.org/x/net (https fetch: dial tcp i/o timeout

    今天想用goquery时,报错说golang.org\x\net\html没安装. ..\github.com\andybalholm\cascadia\selector.go:9:2: cannot ...

  3. python库下载安装报错_python3.6下Numpy库下载与安装图文教程

    今天在做Plotly的散点图时,需要Numpy 这个库的使用. 没有安装Numpy这个库的时候,报错一般是下图这样:ModuleNotFoundError: No module named 'nump ...

  4. python导入requests库一直报错原因总结_python pip 安装库文件报错:pip install ImportError: No module named _internal...

    centos6,python3,通过pip安装pycurl出现报错提示 Centos6.7系统,python3.6.7,通过 pip 安装pycurl出现报错: __main__.Configurat ...

  5. CMake:安装自己编写的动态库,报错

    CMake:安装自己编写的动态库,报错"file INSTALL cannot copy file" 具体情况如下: 原因: 权限问题. 安装共享库有时需要root密码,执行sud ...

  6. Python在指定环境下安装第三方库的报错解决办法

    Python在指定环境下安装第三方库的报错解决办法 在python安装第三方库时,如果直接打开cmd命令提示符,并输入下列安装命令,则会默认安装在base环境下 但base环境下的包新建的虚拟环境是无 ...

  7. pip安装报错:'ascii'码不能解码,安装路径有中文

    转载自:https://blog.csdn.net/u013948858/article/details/77800663 [python]pip安装报错UnicodeDecodeError: 'as ...

  8. Ubuntu用apt-get安装报错:E: Could not get lock /var/lib/dpkg/lock-frontend - open (11:资源暂时不可用)

    Ubuntu用apt-get安装报错:E: Could not get lock /var/lib/dpkg/lock-frontend - open (11:资源暂时不可用) 文章目录: 一.错误原 ...

  9. gitlab 安装报错:Could not find modernizr-2.6.2 in any of the sources

    gitlab 安装报错:Could not find modernizr-2.6.2 in any of the sources 2014-04-30 15:27:44 标签:gitlab 原创作品, ...

最新文章

  1. 一种新的高级抖动分离解析方法
  2. hdu2059:龟兔赛跑
  3. windows键按了没反应_windows快捷键使用 - 小怜
  4. Hive之函数与自定义函数
  5. HDU3348 coins【贪心】
  6. corosynclib+drbd+mysql组合应用
  7. Linux: kill
  8. 修炼Python基础篇-字典(Dictionary)学习
  9. displaytag手册
  10. RubyOnRails培训大纲
  11. JDK 和 JRE 有什么区别
  12. android烧写固定MAC,小系统SN号和MAC地址快速烧录的方法与流程
  13. 报警c语言程序,PIC单片机警报声C程序
  14. 转载:SpringBoot非官方教程 | 第二十四篇: springboot整合docker
  15. 第二周学习前端总结与感悟(一)
  16. linux indent添加,linux indent格式化代码
  17. 消费金融进入“第二赛段”,突围关键是什么?
  18. Debian本地源的创建及应用
  19. 大衣哥触底反弹,和合国际传收购孟文豪《火火的情怀》
  20. 接口显示返回值正常,但是拿到的值却是undefined?

热门文章

  1. 【美图】从字符串 com.meitu/mtxx/6.8.0(ios10.2)/lang:zh 中取出6.8.0
  2. 刷脸支付商用之火真正出现燎原的苗头
  3. DAO跨事物调用---转账
  4. win7上编译ipmitool
  5. linux进入vi界面后命令,教你Linux-vi编辑器的常用命令
  6. docker私服配置
  7. 4、时间同步的ntp服务安装与配置。
  8. LocalDate获取本日所在周的周一和周日
  9. 图说卡尔曼滤波(C++实现)
  10. 苹果参加618,押注天猫首战5小时卖出5亿,天猫已成行业3C领导者