简体   繁体   English

库未加载:libssl.1.0.0.dylib原因:找不到图像

[英]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.

相关问题 使用flask_mysqldb获取“库未加载:libssl.1.0.0.dylib”,“原因:找不到图像” - Getting "Library not loaded: libssl.1.0.0.dylib", "Reason: image not found" with flask_mysqldb 导入 psycopg2 库未加载:libssl.1.0.0.dylib - Import psycopg2 Library not loaded: libssl.1.0.0.dylib Mac上的MySQL和Django-未加载libssl.1.0.0.dylib - MySQL and Django on Mac - libssl.1.0.0.dylib not loaded MAMP Python-MySQLdb问题:一旦调用Python文件,libssl.1.0.0.dylib的路径就会改变 - MAMP Python-MySQLdb issue: Path to libssl.1.0.0.dylib changing once Python file called 导入 pycurl:未加载库:@rpath/libcrypto.1.1.dylib:原因:找不到图像 - import pycurl: Library not loaded: @rpath/libcrypto.1.1.dylib : Reason: image not found 库 (dylib) 未加载 - 找不到图像 - Python IDE - Library (dylib) not loaded - image not found - Python IDE 库未加载:/usr/local/opt/mysql/lib/libmysqlclient.21.dylib和原因映像未找到 - Library not loaded: /usr/local/opt/mysql/lib/libmysqlclient.21.dylib and Reason image not found 库未加载:@ rpath / libopenblasp-r0.2.19.dylib multiarray.cpython-36m-darwin.so原因:找不到图像 - Library not loaded: @rpath/libopenblasp-r0.2.19.dylib multiarray.cpython-36m-darwin.so Reason: image not found psycopg2 安装错误 - 未加载库:libssl.dylib - psycopg2 installation error - Library not loaded: libssl.dylib 库未加载:@rpath/libmysqlclient.21.dylib 原因:找不到图像 Django 使用 mysqlclient DB 驱动程序迁移错误和 MySQL 8 with macOS - Library not loaded: @rpath/libmysqlclient.21.dylib Reason: image not found Django migrate error using mysqlclient DB driver and MySQL 8 with macOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM