[英]library not loaded: libssl.1.0.0.dylib reason: image not found
I am getting the following error (on osx): 我在osx上收到以下错误:
Traceback (most recent call last):
File "./permission_analysis.py", line 9, in <module>
import psycopg2
File "/Library/Python/2.7/site-packages/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Python/2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: libssl.1.0.0.dylib
Referenced from: /Library/Python/2.7/site-packages/psycopg2/_psycopg.so
Reason: image not found
So this looks a lot like this question: 所以这看起来很像这个问题:
Psycopg2 image not found 找不到Psycopg2图像
Except that the most popular upvoted answer doesn't work: 除非最受欢迎的投票答案不起作用:
$ sudo ln -s /Library/PostgreSQL/9.2/lib/libssl.1.0.0.dylib /usr/lib
$ sudo ln -s /Library/PostgreSQL/9.2/lib/libcrypto.1.0.0.dylib /usr/lib
If I try to do either of those commands, it says the file already exists. 如果我尝试执行这些命令中的任何一个,则表明该文件已存在。
I feel your pain with trying to get Psycopg2 to work on Mac. 尝试让Psycopg2在Mac上运行时,我感到很痛苦。 I tried for ages, but i got it working in the end.
我尝试了很长时间,但最终还是成功了。
I asked this question and answered it here 我问了这个问题并在这里回答了
Thanks guys.
多谢你们。
@maxymoo I went with your suggestion. @maxymoo我同意你的建议。 I have installed anaconda2.
我已经安装了anaconda2。 The install updated my path to include /anaconda/bin.
安装将我的路径更新为包含/ anaconda / bin。
Then using the navigator I installed pyscopg2. 然后使用导航器安装了pyscopg2。 Now I am able to use this in the shebang and my scripts execute fine and i'm able to import this module.
现在,我可以在shebang中使用它,并且我的脚本可以正常执行,并且可以导入此模块。
Gurmokhs-MBP:rest Gurmokh$ python
Python 2.7.12 |Anaconda 4.2.0 (x86_64)| (default, Jul 2 2016, 17:43:17)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import psycopg2
if psycopg2.connect("dbname='postgres' user='postgres' host='localhost'"):
... print "connection made"
...
connection made
>>>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.