Skip to content

Instantly share code, notes, and snippets.

@nitrag
Created October 6, 2017 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nitrag/e5b18f2fe5950e52fc286cf77d57d41d to your computer and use it in GitHub Desktop.
Save nitrag/e5b18f2fe5950e52fc286cf77d57d41d to your computer and use it in GitHub Desktop.
Install GDAL on OSX (virtualenv)
# what a headache!
# 10-05-2017
# FIRST!
# Install kyngchaos 1.11 complete:
# http://www.kyngchaos.com/software/frameworks
# Go into your folder where your virtualenv lives and activate
source bin/activate
# Build in tmp?
cd /tmp
pip download GDAL==1.11.2 (or whichever version you want)
tar -zxvf GDAL-1.11.2.tar.gz
cd GDAL-1.11.2
export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments
python setup.py build_ext\
--gdal-config=/Library/Frameworks/GDAL.framework/Versions/1.11/unix/bin/gdal-config\
--library-dirs=/Library/Frameworks/GDAL.framework/Versions/1.11/unix/lib/\
--include-dirs=/Library/Frameworks/GDAL.framework/Versions/1.11/Headers/
# Build and install:
python setup.py build
python setup.py install
# Test
cd /back/to/project
python manage.py runserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment