dis*_*dng 6 python postgresql pip psycopg2 libssl
我最近卸载了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
Run Code Online (Sandbox Code Playgroud)
我通过端口安装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
Run Code Online (Sandbox Code Playgroud)
这里有一些答案,其中讨论了将这些库与符号链接到postgresql安装目录.显然,这对我不起作用.
我该怎么办?
Aks*_*ori 14
只需在终端中使用以下命令(使用正确的 postgresql 版本)
$ brew unlink postgresql@14
$ brew link libpq --force
https://github.com/opentable/otj-pg-embedded/issues/152#issuecomment-954348544
dis*_*dng 12
原来/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
Run Code Online (Sandbox Code Playgroud)
解决了这个问题.
Dev*_*B2F 11
我收到错误
库未加载:'/usr/local/opt/postgresql/lib/libpq.5.dylib'
原因:尝试:'/usr/local/opt/postgresql/lib/libpq.5.dylib'(没有这样的文件),'/usr/local/lib/libpq.5.dylib'(没有这样的文件),'/ usr/lib/libpq.5.dylib'(没有这样的文件)
运行 Django 项目并修复它时,我必须卸载 pip 包:
pip uninstall psycopg2
pip uninstall psycopg2-binary
Run Code Online (Sandbox Code Playgroud)
然后再次安装它们:
pip install psycopg2
pip install psycopg2-binary
Run Code Online (Sandbox Code Playgroud)
这使得项目运行没有错误。