dyld: lazy symbol binding failed: Symbol not found: _PQsetErrorContextVisibility

一世执手 提交于 2020-06-11 18:08:30

问题


On running

$ psql

I get this error

dyld: lazy symbol binding failed: Symbol not found: 
_PQsetErrorContextVisibility
Referenced from: /usr/local/bin/psql
Expected in: /usr/local/lib/libpq.5.dylib

dyld: Symbol not found: _PQsetErrorContextVisibility
Referenced from: /usr/local/bin/psql
Expected in: /usr/local/lib/libpq.5.dylib

Abort trap: 6

I have tried a few things:

  1. few posts suggested to update brew
  2. few suggested adding /usr/local/bin/psql to the ~/.bash_profile and restarting the system
  3. few said it was problem with XCode but I do not have XCode installed so it isnt valid for me I guess.

but none of it worked.

my bash_profile looks like this

PATH="/usr/local/bin/psql:/usr/local/sbin:/usr/local/bin:/sbin:/bin
:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin/geckodrive‌​r:$PATH"
export PATH

I am using:

  • psql (PostgreSQL) 9.6.2
  • macOS Sierra version 10.12.3

回答1:


I was on PostgreSQL 9.6.2 as well, and ran into the same problem.

I upgraded to 9.6.3 using brew like this:

rm '/usr/local/lib/libpq.5.dylib'
brew upgrade postgresql
brew link postgresql

It worked, and now I have access via psql again.




回答2:


The thing that worked for me was uninstalling and reinstalling postgres using the code below:

brew uninstall postgresql
brew install postgresql


来源:https://stackoverflow.com/questions/44393800/dyld-lazy-symbol-binding-failed-symbol-not-found-pqseterrorcontextvisibility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!