博文背景
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安装包。
双击安装即可安装完成。
再后面就可以使用pip install来安装需要编译的第三方包了。
这个方法虽然解决了问题,但感觉不是最标准的解决办法。
另一种解决思路:使用最新版VS安装最核心的编译组件。
安装MSBuild Tools和MSVC和Windows 10 SDK是我个人感觉的最小化安装方式。
安装完成后即可使用pip install来安装需要编译的第三方包。
扩展:使用wheel来自制whl包还有推送到pypi源,这样才能懂根本原理。文章来源:https://www.toymoban.com/news/detail-451408.html
附录:静默安装参考https://docs.microsoft.com/en-us/answers/questions/192162/visual-studio-build-tools-silent-install.html文章来源地址https://www.toymoban.com/news/detail-451408.html
到了这里,关于Python解决Microsoft Visual C++14.0 is required问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!