[Fixed]-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-tools
brew cleanup
brew install geos
brew install gdal geoip libspatialite librasterlite spatialite-gui spatialite-tools
brew 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.


Same here – after installing everything as directed, I went back and added the KyngChaos libraries, then added the three export statements to my ~/.bash_profile as listed above. This fixed my issue.


I had this same issue and was able to solve it by uninstalling GDAL from Homebrew and installing the GDAL Complete package from KyngChaos: http://www.kyngchaos.com/software/frameworks



Had the same issue (Mac OSX) and solved it by creating a sym link from where I found the lib folder to where python was looking for it in the error message.

ln -s /usr/local/Cellar/geos/3.10.3/lib/libgeos_c.dylib ~/PycharmProjects/project/venv/lib/libgeos_c.dylib

None of the environment variables worked, nor reinstalling


Leave a comment