Skip to content

Instantly share code, notes, and snippets.

@StefRe
Last active August 13, 2025 12:02
Show Gist options
  • Select an option

  • Save StefRe/ae40d1b6204c8363b84d5c28856a4479 to your computer and use it in GitHub Desktop.

Select an option

Save StefRe/ae40d1b6204c8363b84d5c28856a4479 to your computer and use it in GitHub Desktop.
Install VS Build Tools on Windows 10 without admin permissions for usage with Cython
  1. Install VS Build Tools using PortableBuildTools
    https://github.com/Data-Oriented-House/PortableBuildTools

  2. for version 14.44.17.14 it creates devcmd.bat in the vs_BuildTools folder

    • copy this devcmd.bat to VC\vcvarsall.bat
    • in vcvarsall.bat create an environment variable LIBPATH and set it to the same value as LIB
      (query_vcvarsall in distuils msvc9compiler needs LIBPATH in addition to LIB)
  3. set VS140COMNTOOLS to the vs_BuildTools\VC\Tools folder
    (this makes sure vcvarsall.bat is being found by distutils)

  4. set DISTUTILS_USE_SDK=1 / $env:DISTUTILS_USE_SDK=1
    execute devcmd.bat / devcmd.ps1

Steps 3 and 4 can be included in devcmd.bat:

set VS140COMNTOOLS=%BUILD_TOOLS_ROOT%VC\Tools
set DISTUTILS_USE_SDK=1 

or devcmd.ps1:

$env:VS140COMNTOOLS =  (Join-Path $InstallPath '\VC\Tools')
$env:DISTUTILS_USE_SDK = 1  

Now you can install packages from source with cython, e.g. pip install outliertree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment