asawin@Asawins-MacBook-Air ~ % lib otool -L libpq.5.dylib
zsh: command not found: lib
asawin@Asawins-MacBook-Air ~ % install_name_tool
Usage: /Library/Developer/CommandLineTools/usr/bin/install_name_tool [-change old new] … [-rpath old new] … [-add_rpath new] … [-delete_rpath old] … [-id name] input
asawin@Asawins-MacBook-Air ~ % lib
zsh: command not found: lib
asawin@Asawins-MacBook-Air ~ % find / -name libpq.5.dylib 2>/dev/null
/System/Volumes/Data/Users/asawin/.pyenv/versions/3.12.7/envs/set-data-management-macos/lib/python3.12/site-packages/psycopg2/.dylibs/libpq.5.dylib
/System/Volumes/Data/Applications/Postgres.app/Contents/Versions/17/lib/libpq.5.dylib
/System/Volumes/Data/Applications/pgAdmin 4.app/Contents/Frameworks/libpq.5.dylib
/Users/asawin/.pyenv/versions/3.12.7/envs/set-data-management-macos/lib/python3.12/site-packages/psycopg2/.dylibs/libpq.5.dylib
/Applications/Postgres.app/Contents/Versions/17/lib/libpq.5.dylib
/Applications/pgAdmin 4.app/Contents/Frameworks/libpq.5.dylib
asawin@Asawins-MacBook-Air ~ % echo $PATH
/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims:/Users/asawin/.pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Applications/Postgres.app/Contents/Versions/17/lib
asawin@Asawins-MacBook-Air ~ % ls /Applications/Postgres.app/Contents/Versions/17/lib
gdalplugins libgeos_c.1.19.0.dylib libicutu.75.dylib libopenjp2.7.dylib libproj.dylib
libboost_serialization.dylib libgeos_c.1.dylib libicutu.dylib libopenjp2.dylib libssl.3.dylib
libboost_system.dylib libgeos_c.dylib libicuuc.75.1.dylib libpgcommon.a libssl.dylib
libboost_thread.dylib libicudata.75.1.dylib libicuuc.75.dylib libpgcommon_shlib.a libtiff.6.dylib
libboost_wserialization.dylib libicudata.75.dylib libicuuc.dylib libpgfeutils.a libtiff.dylib
libcrypto.3.dylib libicudata.dylib libjpeg.9.dylib libpgport.a libtiffxx.6.dylib
libcrypto.dylib libicui18n.75.1.dylib libjpeg.dylib libpgport_shlib.a libtiffxx.dylib
libecpg.6.dylib libicui18n.75.dylib libjson-c.5.4.0.dylib libpgtypes.3.dylib libxml2.2.dylib
libecpg.dylib libicui18n.dylib libjson-c.5.dylib libpgtypes.dylib libxml2.dylib
libecpg_compat.3.dylib libicuio.75.1.dylib libjson-c.dylib libpng.dylib libzstd.1.5.6.dylib
libecpg_compat.dylib libicuio.75.dylib liblz4.1.10.0.dylib libpng16.16.dylib libzstd.1.dylib
libgdal.34.3.8.5.dylib libicuio.dylib liblz4.1.dylib libpng16.dylib libzstd.dylib
libgdal.34.dylib libicutest.75.1.dylib liblz4.dylib libpq.5.dylib postgresql
libgdal.dylib libicutest.75.dylib libnetcdf.19.dylib libpq.dylib
libgeos.3.13.0.dylib libicutest.dylib libnetcdf.dylib libproj.25.9.5.0.dylib
libgeos.dylib libicutu.75.1.dylib libopenjp2.2.5.2.dylib libproj.25.dylib
asawin@Asawins-MacBook-Air ~ % otool
Usage: /Library/Developer/CommandLineTools/usr/bin/otool [-arch arch_type] [-fahlLDtdorSTMRIHGvVcXmqQjCP] [-mcpu=arg] [–version]
asawin@Asawins-MacBook-Air ~ % otool -L libpq.5.dylib
error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can’t open file: libpq.5.dylib (No such file or directory)
asawin@Asawins-MacBook-Air ~ % install_name_tool
Usage: /Library/Developer/CommandLineTools/usr/bin/install_name_tool [-change old new] … [-rpath old new] … [-add_rpath new] … [-delete_rpath old] … [-id name] input
asawin@Asawins-MacBook-Air ~ % nano ~/.profile
asawin@Asawins-MacBook-Air ~ % export DYLD_LIBRARY_PATH=/Applications/Postgres.app/Contents/Versions/17/lib:$DYLD_LIBRARY_PATH
asawin@Asawins-MacBook-Air ~ % echo $PATH
/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims:/Users/asawin/.pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Applications/Postgres.app/Contents/Versions/17/lib
asawin@Asawins-MacBook-Air ~ % echo $DYLD_LIBRARY_PATH
/Applications/Postgres.app/Contents/Versions/17/lib:
asawin@Asawins-MacBook-Air ~ % sudo ln -s /Applications/Postgres.app/Contents/Versions/17/lib/libpq.5.dylib /usr/local/lib/libpq.5.dylib
Password:
ln: /usr/local/lib/libpq.5.dylib: No such file or directory
asawin@Asawins-MacBook-Air ~ % sudo chmod 755 /Applications/Postgres.app/Contents/Versions/17/lib/libpq.5.dylib
asawin@Asawins-MacBook-Air ~ % sudo ln -s /Applications/Postgres.app/Contents/Versions/17/lib/libpq.5.dylib /usr/local/lib/libpq.5.dylib
ln: /usr/local/lib/libpq.5.dylib: No such file or directory
asawin@Asawins-MacBook-Air ~ % nano ~/.zshrc
asawin@Asawins-MacBook-Air ~ % source ~/.zshrc
asawin@Asawins-MacBook-Air ~ % echo $DYLD_LIBRARY_PATH
/Applications/Postgres.app/Contents/Versions/17/lib:/Applications/Postgres.app/Contents/Versions/17/lib:
asawin@Asawins-MacBook-Air ~ % nano ~/.profile
asawin@Asawins-MacBook-Air ~ % nano ~/.zshrc
asawin@Asawins-MacBook-Air ~ % echo $DYLD_LIBRARY_PATH
/Applications/Postgres.app/Contents/Versions/17/lib:/Applications/Postgres.app/Contents/Versions/17/lib:
asawin@Asawins-MacBook-Air ~ % echo $PATH
/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims:
/Users/asawin/.pyenv/shims:
/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims:
/opt/homebrew/bin:
/opt/homebrew/sbin:
/usr/local/bin:
/System/Cryptexes/App/usr/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
/Library/Apple/usr/bin:
/Applications/Postgres.app/Contents/Versions/latest/bin:
/Applications/Postgres.app/Contents/Versions/17/lib:
/Applications/Postgres.app/Contents/Versions/17/lib
asawin@Asawins-MacBook-Air ~ %