Deploy wheel build environment with MSVC v141 2017 on Python (Anaconda)

Download visual C++ build tools 2019 from Microsoft
Install vs_buildtools__*.exe
Select additional components in "individual components" Tab:
  • Visual C++ Build Tools core features
  • Windows 10 SDK (any verison)
  • MSVC v141 - VS 2017 C++ x64/x86  Build Tools (v14.16)
Install miniconda from conda website
Select and download Miniconda3 Windows 64-bit
Install Miniconda3-latest-Windows-x86_64.exe with all default settings.

Create conda environment
Open Start Menu\Anaconda3 (64-bit)\Anaconda Prompt (miniconda3)

cmd>
conda create -n YOUR_ENV_NAME python vs2017_win-64

Modify file with notepad
%HOMEPATH%\miniconda3\envs\YOUR_ENV_NAME\etc\conda\activate.d\vs2017_compiler_vars.bat
Line 60:
  CALL "VC\Auxiliary\Build\vcvars%BITS%.bat" -vcvars_ver=14.16 %WindowsSDKVer%
To:
  CALL "VC\Auxiliary\Build\vcvarsall.bat" %target_platform% -vcvars_ver=14.16 %WindowsSDKVer%
Activate your environment:
conda activate YOUR_ENV_NAME
If the output like these, that means wheel build environment with MSVC v141 is deployed successfully.
>SET DISTUTILS_USE_SDK=1

>SET MSSdk=1

>SET "VS_VERSION=15.0"

>SET "VS_MAJOR=15"

>SET "VS_YEAR=2017"

>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"

>set "MSYS2_ENV_CONV_EXCL=CL"

>set "PY_VCRUNTIME_REDIST=\bin\vcruntime140.dll"

>set "CXX=cl.exe"

>set "CC=cl.exe"

>CALL %HOMEPATH%\miniconda3\envs\k4a\etc\conda\activate.d\vs2017_get_vsinstall_dir.bat
Windows SDK version found as: "10.0.17134.0"
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.7.5
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

Comments

Popular posts from this blog

How to make samba server visible in Windows 10 network.