[Fixed]-GeoDjango can't find geos library

14👍

Just in case some developers are facing this problem on Ubuntu, I solved it just installing libgeos-lib

sudo apt-get install libgeos-dev

6👍

I had the same problem with postgis via MacPorts in combination with Django, although I could execute select postgis_full_version(); without issues. This answer helped me: http://pragmaticstartup.wordpress.com/2012/09/30/django-core-exceptions-improperlyconfigured-could-not-import-user-defined-geometry_backend-geos/

The solution for me was to add

export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/opt/local/lib/

to ~/.profile. (Don’t forget to source it before trying again)

6👍

I found that I’d originally installed geos through pip.

Once I downloaded the new GEOS library from:
http://www.kyngchaos.com/software/frameworks#geos

Then installed it.

Last, I added to my path (~/.bash_profile):

export PATH=/Library/Frameworks/GEOS.framework/Versions/3/unix/lib/:$PATH

It worked fine.

1👍

Have you installed the geos library?

It’s included in the instructions for installing GeoDjango with macports.

Leave a comment