missing libgeos_c.so on OSX missing libgeos_c.so on OSX postgresql postgresql

missing libgeos_c.so on OSX


Sorry, that KyngChaos solution completely defeats the purpose of using homebrew.

The answer for homebrew users (at least, for this one) is to uninstall geos and its dependencies and then reinstall geos and then its dependencies.

This worked for me:

brew uninstall geos gdal geoip libspatialite librasterlite spatialite-gui spatialite-toolsbrew cleanupbrew install geosbrew install gdal geoip libspatialite librasterlite spatialite-gui spatialite-toolsbrew cleanup

It seems some geos dependencies are getting out of sync.

You can verify the libraries that need to be installed by tracking what this returns:

python -c 'import _ctypes; _ctypes.dlopen("/usr/local/lib/libgdal.dylib")'

You'll see something like

Reason: Incompatible library version: [some geos dependent library].dylib requires version X.X.X or later, but libgeos_c.1.8.0.dylib provides version X.X.X.brew uninstall [some geos dependency]brew install [some geos dependency]brew cleanup

Then rerun the above python command and either the problem will be resolved or it'll reveal another dependency to uninstall/install.


I solved it this way.

$ brew install postgresql$ brew install postgis$ brew install gdal$ brew install libgeoip

then in Django settings set this:

GEOS_LIBRARY_PATH = '/usr/local/Cellar/geos/3.4.2/lib/libgeos_c.1.dylib'

Then it worked for me.


The installation instructions appears to hold the answer, which is to set the environment variable $GEOS_LIBRARY_PATH.