9

我最近卸载了 postgresql 并通过 pip 安装了 pyscopg2。

我知道 libcrypto 和 libssl 有一些技巧

目前我将它们符号链接到:

$ ls -lah libssl.*
-rwxr-xr-x  1 root  wheel   402K Aug 28 11:06 libssl.0.9.7.dylib
-rwxr-xr-x  1 root  wheel   589K Aug 28 11:06 libssl.0.9.8.dylib
lrwxr-xr-x  1 root  wheel    55B Nov 29 23:38 libssl.1.0.0.dylib -> /usr/local/Cellar/openssl/1.0.1c/lib/libssl.1.0.0.dylib
lrwxr-xr-x  1 root  wheel    55B Nov 30 02:25 libssl.dylib -> /usr/local/Cellar/openssl/1.0.1c/lib/libssl.1.0.0.dylib

/usr/lib
$ ls -lah libcrypto.*
-rwxr-xr-x  1 root  wheel   2.1M Aug 28 11:06 libcrypto.0.9.7.dylib
-rwxr-xr-x  1 root  wheel   2.6M Aug 28 11:06 libcrypto.0.9.8.dylib
-r-xr-xr-x  1 root  wheel   1.6M Oct 31 22:12 libcrypto.1.0.0.dylib
lrwxr-xr-x  1 root  wheel    58B Nov 30 02:27 libcrypto.dylib -> /usr/local/Cellar/openssl/1.0.1c/lib/libcrypto.1.0.0.dylib

我通过端口安装了openssl

现在当我运行 arc diff 时,我得到了臭名昭著的

$ arc diff
dyld: Library not loaded: /usr/lib/libpq.5.dylib
  Referenced from: /usr/bin/php
  Reason: image not found
Trace/BPT trap: 5

这里有一些答案在这里讨论了将这些库符号链接到 postgresql 安装目录。显然,这对我不起作用。

我应该怎么办?

4

3 回答 3

14

原来 /usr/lib/libpq.5.dylib 不存在,但 /usr/lib/libpq.5.4.dylib 不存在。

sudo ln -s /usr/lib/libpq.5.4.dylib /usr/lib/libpq.5.dylib

解决了这个问题。

于 2012-11-30T20:05:38.553 回答
3

与@Pablo Marambio 不同,我通过将以下行添加到~/.profile

export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib:$DYLD_LIBRARY_PATH

对于 Postgres.app v9.3.5.0(可能还有其他),我添加了以下行:

export DYLD_LIBRARY_PATH=/Applications/Postgres.app/Contents/Versions/9.3/lib:$DYLD_LIBRARY_PATH

然后,当然,运行source ~/.profile

于 2014-09-25T18:49:49.510 回答
2

为了解决这个问题,我不得不卸载 postgresql 然后重新安装。

$ brew uninstall postgresql

$ brew update

$ brew install postgres
于 2020-03-10T05:30:03.123 回答