GeoDjango can't find geos library GeoDjango can't find geos library postgresql postgresql

GeoDjango can't find geos library


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

sudo apt-get install libgeos-dev


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)


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.