pip 安装时遇到 Microsoft Visual C++ 14.0 or greater is required

在 Windows 上用 pip 安装部分包时,如果缺少 C++ 编译环境,会报如下错误:

1
2
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]

网上能找到的不少教程已经过期了。目前亲测有效的办法很简单:直接打开错误提示里的链接。

安装步骤

  1. 访问 Microsoft C++ Build Tools
  2. 下载 Download Build Tools 并运行安装程序
  3. 在工作负载里勾选 Windows → Desktop development with C++
  4. 确认安装,等待完成

装好之后重新 pip install,一般就能正常编译安装了。

Notice: 正常情况下,这里会有一个基于utteranc.es的留言系统,如果看不到,可能要想想办法才能看到。

Powered by Hexo and Hexo-theme-hiker

Copyright © 2012 - 2026 tiaobug.com All Rights Reserved.

鲁ICP备2024124237号-1