Created
October 10, 2019 02:13
-
-
Save underchemist/bcb4919f7b2fada3ee48aeb9d095d4b0 to your computer and use it in GitHub Desktop.
Compiling GDAL python bindings on windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Assumes visual studio build tools installed | |
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat | |
conda activate <env name> | |
conda install -c conda-forge gdal | |
rem Uninstalling pre-installed python bindings to show that we can compile ourselves | |
pip uninstall gdal | |
rem Set environment variables | |
set INCLUDE=C:\<conda install location>\envs\<env name>\Library\include;%INCLUDE% | |
set LIB=C:\<conda install location>\envs\<env name>\Library\lib;%LIB% | |
pip install gdal | |
rem alternatively | |
rem pip install --global-option=build_ext --global-option="-IC:\<conda install location>\envs\<env name>\Library\include" --global-option="-LC:\<conda install location>\envs\<env name>\Library\lib" gdal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment