Python解决Microsoft Visual C++14.0 is required问题

博文背景
pip install meshpy

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/

解决办法

网上会有很多文章推荐使用visualcppbuildtools_full.exe进行安装。但是会遇到如下问题:显示安装包丢失或损坏。
安装包丢失

大多数人的第一反应是境内的网不太好,有人说用各种代理法来解决,搞半天还是搞不定,其实不是这样的。

请看https://docs.microsoft.com/en-us/answers/questions/440704/a-setup-package-is-either-missing-or-damaged-error.html显示:

Welcome to Microsoft Q&A!

Please have a try with visual studio 2015 enterprise with update 3 ISO image. Download the DVD file in this page, it includes most of packages from the downloading process, but it still needs internet connection during the installation. On April 26, 2021, Visual Studio 2015 and older web installer files were removed from the Microsoft Download Center.

We look forward to hearing from you.

Sincerely,
Peng

根据On April 26, 2021, Visual Studio 2015 and older web installer files were removed from the Microsoft Download Center的显示解决办法是These products can be installed from ISO images available at Downloads - Visual Studio Subscriptions Portal下载Visual C++ Build Tools for Visual Studio 2015 with Update 3这个ISO安装包。

MS Downloads

Visual C++ Build Tools for Visual Studio 2015 with Update 3

双击安装即可安装完成。

再后面就可以使用pip install来安装需要编译的第三方包了。

这个方法虽然解决了问题,但感觉不是最标准的解决办法。

另一种解决思路:使用最新版VS安装最核心的编译组件。

Visual Studio Installer

安装MSBuild Tools和MSVC和Windows 10 SDK是我个人感觉的最小化安装方式。

安装完成后即可使用pip install来安装需要编译的第三方包。

扩展:使用wheel来自制whl包还有推送到pypi源,这样才能懂根本原理。

附录:静默安装参考https://docs.microsoft.com/en-us/answers/questions/192162/visual-studio-build-tools-silent-install.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值