解决【 error: Microsoft Visual C++ 14.0 or greater is required】安装问题

释放双眼,带上耳机,听听看~!
解决Python包安装时出现的【 error: Microsoft Visual C++ 14.0 or greater is required】问题,提供解决方法和建议

兄弟们,有没有遇到过【 error: Microsoft Visual C++ 14.0 or greater is required】怎么办?

经常遇到,这次就拿出来给大家看看!!!

1.遇到问题啦

我在兴致勃勃的安装包,什么?你居然安装不下来?

pip install paddleocr paddlenlp paddlespeech moviepy

夸嚓,一下子,红颜色字就出来了,这怎么整?

  Building wheel for webrtcvad (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating buildlib.win-amd64-cpython-39
      copying webrtcvad.py -> buildlib.win-amd64-cpython-39
      running build_ext
      building '_webrtcvad' extension
      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/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for webrtcvad
  
  。
  。
  。
  
  error: subprocess-exited-with-error

  × Running setup.py install for webrtcvad did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      running install
      I:miniconda3envsp2libsite-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating buildlib.win-amd64-cpython-39
      copying webrtcvad.py -> buildlib.win-amd64-cpython-39
      running build_ext
      building '_webrtcvad' extension
      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/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> webrtcvad

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

2.网上的解决办法

查看错误信息,给出的是 error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: visualstudio.microsoft.com/visual-cpp-…

看出来是需要新版本的 Microsoft C++ Build Tools,并给出了地址,这个要记下来,接下来要考。
打开网址:visualstudio.microsoft.com/zh-hans/vis… ,Microsoft C++ 生成工具,独立 MSVC 编译器、库和脚本。直接下载就是。

3.安装Microsoft C++ 生成工具

点击单个组件,电机安装MSVC v143-VS 2022 C++ x64/86生成工具(最新),安装即可,接下来再试试。

解决【 error: Microsoft Visual C++ 14.0 or greater is required】安装问题

4.原因剖析

4.1原版解释

Even though Python is an interpreted language, you may need to install Windows C++ compilers in some cases. Unlike Linux, compilers for Windows are not included by default in the OS.

For example, you will need to use them if you wish to:

4.2中文意思

尽管Python是一种解释型语言,但在某些情况下可能需要安装Windows c++编译器。与Linux不同,Windows的编译器在默认情况下不包括在操作系统中。
因此,你需要安装编译器

  • 用源码安装一个非纯python的包
  • 编译cython 或 Pyrex 文件

具体可以看python文档,说的比较细致:
wiki.python.org/moin/Window… ,并给出了版本搭配。

Visual C++ CPython
14.x 3.5 – 3.10
10.0 3.3 – 3.4
9.0 2.6 – 2.7, 3.0 – 3.2

解决【 error: Microsoft Visual C++ 14.0 or greater is required】安装问题

本文正在参加 人工智能创作者扶持计划

本网站的内容主要来自互联网上的各种资源,仅供参考和信息分享之用,不代表本网站拥有相关版权或知识产权。如您认为内容侵犯您的权益,请联系我们,我们将尽快采取行动,包括删除或更正。
AI教程

高斯分布及其在MLE中的应用

2023-12-17 20:11:14

AI教程

SimSiam算法:无监督视觉表征学习的新方法

2023-12-17 20:22:14

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索