已经安装vs依然显示error: Microsoft Visual C++ 14.0 or greater is required.

这篇具有很好参考价值的文章主要介绍了已经安装vs依然显示error: Microsoft Visual C++ 14.0 or greater is required.。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

报错信息

在 Windows 下的 Conda 环境中pip install一些需要现场编译的库时经常会报错:

  Building wheel for pyopenjtalk (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\Miniconda3\envs\dl\python.exe' 'D:\Miniconda3\envs\dl\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\Administrator\AppData\Local\Temp\tmpvdg4l0qp'
       cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-jpy19xi8\pyopenjtalk_5c83910e21044265aad3fbfcb35bbc2e
  Complete output (21 lines):
  fatal: not a git repository (or any of the parent directories): .git
  running bdist_wheel
  running build
  running build_py
  -- Building version 0.3.0
  creating build\lib.win-amd64-3.7
  creating build\lib.win-amd64-3.7\pyopenjtalk
  copying pyopenjtalk\utils.py -> build\lib.win-amd64-3.7\pyopenjtalk
  copying pyopenjtalk\version.py -> build\lib.win-amd64-3.7\pyopenjtalk
  copying pyopenjtalk\__init__.py -> build\lib.win-amd64-3.7\pyopenjtalk
  creating build\lib.win-amd64-3.7\pyopenjtalk\htsvoice
  copying pyopenjtalk\htsvoice\LICENSE_mei_normal.htsvoice -> build\lib.win-amd64-3.7\pyopenjtalk\htsvoice
  copying pyopenjtalk\htsvoice\mei_normal.htsvoice -> build\lib.win-amd64-3.7\pyopenjtalk\htsvoice
  copying pyopenjtalk\htsvoice\README.md -> build\lib.win-amd64-3.7\pyopenjtalk\htsvoice
  running build_ext
  skipping 'pyopenjtalk\openjtalk.cpp' Cython extension (up-to-date)
  skipping 'pyopenjtalk\htsengine.cpp' Cython extension (up-to-date)
  building 'pyopenjtalk.openjtalk' extension
  setup.py:26: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    _CYTHON_INSTALLED = ver >= LooseVersion(min_cython_ver)
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for pyopenjtalk
Failed to build pyopenjtalk
ERROR: Could not build wheels for pyopenjtalk, which is required to install pyproject.toml-based projects

上图为安装pyopenjtalk时的报错信息。

规避方法

我之前遇到这种问题的解决方法是直接下载已经在Windows上编译好的whl文件,然后:

pip install xxx.whl

然而该网站并没有编译好的pyopenjtalk包,因此这次必须解决该错误。

问题原因

根据微软官方问答平台中的说法,应该是Conda环境下pip的构建工具选择错误。

解决方法

pip install之前执行:

SET DISTUTILS_USE_SDK=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64

注意vcvarsall.bat的路径因人而异。

至于为什么要这么做,可以参考下sklearn的高级安装文档。文章来源地址https://www.toymoban.com/news/detail-539029.html

到了这里,关于已经安装vs依然显示error: Microsoft Visual C++ 14.0 or greater is required.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包