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://docs.microsoft.com/en-us/answers/questions/192162/visual-studio-build-tools-silent-install.html