[Fixed]-Missing libgeos_c.so on OSX

23👍

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.

3👍

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.

👤Houman

2👍

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

0👍

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.

0👍

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

👤Liyosi

0👍

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

👤Peter

Leave a comment