Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save underchemist/bd99ef47277ff703748eaa134d689ff9 to your computer and use it in GitHub Desktop.
Save underchemist/bd99ef47277ff703748eaa134d689ff9 to your computer and use it in GitHub Desktop.
Install rasterio from source using vcpkg for GDAL on windows

Install GDAL

Install GDAL and its dependencies as a release version using triplet. This will install to %VCPKG_ROOT%\installed\<triplet>

vcpkg install --triplet=x64-windows-release gdal[tools,webp,zstd,sqlite3,postgresql,openjpeg,png,geos,libspatialite,curl]

Install Rasterio

Virtual Environment

uv venv

Install

set GDAL_VERSION=<GDAL_VERSION>
uv pip install \
       --no-binary rasterio \
       --config-setting="--global-option=build_ext" \
       --config-setting="--global-option=-L%VCPKG_ROOT%\installed\x64-windows-release\lib" \
       --config-setting="--global-option=-lgdal" \
       --config-setting="--global-option=-I%VCPKG_ROOT%\installed\x64-windows-release\include" \
       rasterio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment