0

I am not being able to run pserve due to following error:

File "/usr/local/lib/python2.7/site-packages/psycopg2/__init__.py", line 50, in <module>
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: libpq.5.dylib
  Referenced from: /usr/local/lib/python2.7/site-packages/psycopg2/_psycopg.so
  Reason: image not found

I am on OSX 10.6

Volatil3
  • 14,253
  • 38
  • 134
  • 263

1 Answers1

0

It try to load libpq.5.dylib from the symlink libpq.5.dylib but found not file, so you need to update it:

# TODO: get this from the error, after "Library not loaded:"
SYMLINK_PATH="libpq.5.dylib"

# TODO: find this in your machine. The version maybe different than mine
DESTINATION_PATH="/opt/homebrew/opt/postgresql/lib/postgresql@14/libpq.5.dylib"

sudo mv $SYMLINK_PATH $SYMLINK_PATH.old
sudo ln -s $DESTINATION_PATH $SYMLINK_PATH