Fiona, Rasterio, Shapely binary wheels for OS X

Numpy and SciPy binaries for OS X have been up on PyPI for a few months and I've recently figured out how to do the same for Fiona, Rasterio, and Shapely. As the SciPy developers do, I've used delocate-wheel to (see its README):

  • find dynamic libraries imported from python extensions
  • copy needed dynamic libraries to directory within package
  • update OSX install_names and rpath to cause code to load from copies of libraries

The new Fiona and Rasterio binaries are beefy (14MB) because they include the non-standard libraries that enable format translation, cartographic projection, and computational geometry operations:

$ delocate-listdeps ~/code/frs-wheel-builds/dist/rasterio-0.17.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
@loader_path/.dylibs/libgdal.1.dylib
@loader_path/libgeos-3.4.2.dylib
@loader_path/libgeos_c.1.dylib
@loader_path/libjasper.1.0.0.dylib
@loader_path/libjson-c.2.dylib
@loader_path/libproj.0.dylib

For the small price of a larger download, Mac users now get batteries-included binaries that work immediately. No XCode required. Just pip install rasterio and start using it.

The new binaries are built on 10.9 using Python 2.7.9 and 3.4.2 downloaded from python.org. These Pythons were compiled using the 10.6 SDK for both i386 and x86_64 architectures and I've similarly set MACOSX_DEPLOYMENT_TARGET=10.6 and -arch i386 -arch x86_64 in my own builds. In practice they are intended for 10.9 and 10.10, but will probably work on 10.7 and 10.8. They should work for just about any OS X Python, whether from the system, Homebrew, MacPorts, or python.org.

If you'd rather continue to compile, e.g, Rasterio's modules using your own GDAL installation, you've got an out in pip's --no-use-wheel option:

$ GDAL_CONFIG=/path/to/gdal-config pip install --no-use-wheel rasterio

To contribute to development of these binaries or report installation bugs, please head over to https://github.com/sgillies/frs-wheel-builds. Most importantly, help me spread the word that installation of Fiona, Rasterio, and Shapely on OS X is easier than ever.