GeoDjango setup: ERROR: could not access file "$libdir/postgis-1.5": No such file or directory GeoDjango setup: ERROR: could not access file "$libdir/postgis-1.5": No such file or directory postgresql postgresql

GeoDjango setup: ERROR: could not access file "$libdir/postgis-1.5": No such file or directory


I know this an old question, but i found it using Google, so others might end up here as well.

On my Mac OSX macports install, i had two folders with .so files for postgresql:

/opt/local/lib/postgresql90/

and

/usr/local/pgsql-9.0/lib/

It seems like my installation looked in /opt/local/lib/postgresql90/ and not in /usr/local/pgsql-9.0/lib/, so to install pg_trgm, i had to do the following:

sudo ln -s /opt/local/lib/postgresql90/pg_trgm.so /usr/local/pgsql-9.0/lib/

This should work with any .so file which is not in the right place - In your example it would have been

sudo ln -s /opt/local/lib/postgresql90/postgis-1.5.so /usr/local/pgsql-9.0/lib/

Which allows me to install postgis as well :)


The file /usr/local/Cellar/postgresql9/9.0.17/lib/postgis-1.5.so is missing. This error happened after brew upgrade and the solution is to uninstall postgis and reinstall it with:

brew uninstall postgis15

brew install postgis15

The result should be: PostGIS plugin libraries installed to: /usr/local/Cellar/postgresql9/9.0.17/lib

So afterwards you should find the file /usr/local/Cellar/postgresql9/9.0.17/lib/postgis-1.5.so