Installing geopandas on macOS

--

A short guide to install geopandas on macOS to process Shape files.

Install Proj and Geos

brew install proj geos

Install GDAL

Since there are no prebuilt binaries for macOS, we’ll have to build from source.

https://gdal.org/download.html#development-source

git clone https://github.com/OSGeo/GDAL.git
cd GDAL
./configure --with-python
make # Takes a while
make install

Compilation will take a while, so be patient.

Install pip packages

After GDAL completes compiling, cd out of the directory until you’re in the directory containing GDAL in my case it’s ~/Downloads (which is where I cloned the GDAL subdir source)

Now locate the parent directory of the gdal-config binary. It has to be the parent directory otherwise the pip install will fail.

export GDAL_CONFIG=$(\
find $(pwd) -name gdal-config \
-exec dirname {} \; \
)

Now install the pip libs:

pip install gdal fiona geopandas

--

--

Tristian Azuara
Tristian Azuara

Written by Tristian Azuara

iOS Engineer with a love for automation and internal tooling. Gopher, Pythonista and Haskeller by night. https://www.linkedin.com/in/aztristian/

No responses yet