0

I am trying to import shapefile to PostGIS. I have problem configuring shp2pgsql.

I am getting this error :

dyld: Library not loaded: @loader_path/../lib/liblwgeom-2.1.1.dylib
  Referenced from: /Library/PostgreSQL/9.3/bin/shp2pgsql
  Reason: image not found

I am trying to explore where the command is:

macbook$ locate shp2pgsql
/Library/PostgreSQL/9.3/PostGIS/man/shp2pgsql.1
/Library/PostgreSQL/9.3/bin/shp2pgsql


macbook$ ls /usr/bin/shp2pgsql
/usr/bin/shp2pgsql

I installed "liblwgeom" using homebrew,

macbook$ ls /usr/local/opt/liblwgeom/lib
liblwgeom-2.1.1.dylib

Do you have any idea how to resolve this issue .

3
  • Can you try creating a symlink /Library/PostgreSQL/9.3/lib/liblwgeom-2.1.1.dylib that points to /usr/local/opt/liblwgeom/lib/liblwgeom-2.1.1.dylib, then retry the import?
    – BradHards
    Commented Apr 5, 2014 at 7:18
  • yes ! this is how I solved the prob ! Commented Apr 6, 2014 at 1:35
  • OK, I added that as an answer.
    – BradHards
    Commented Apr 6, 2014 at 1:48

1 Answer 1

1

One way to solve this is to create a symlink /Library/PostgreSQL/9.3/lib/liblwgeom-2.1.1.dylib that points to /usr/local/opt/liblwgeom/lib/liblwgeom-2.1.1.dylib.

There are other ways (setting library path environment variables, using homebrew for everything), but this is probably the most efficient. Note that if you do need to upgrade lwgeom, you may need to create a new symlink.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.