启动odoo出现 `Library not loaded: libssl.1.1.dylib` `Reason: image not found`报错

mac安装odoo出现 Library not loaded: libssl.1.1.dylib
Reason: image not found
解决办法(可能是libssl版本太低了或没有安装)

Traceback (most recent call last):
  File "./odoo-bin", line 5, in <module>
    import odoo
  File "/Users/lawa/odoo-dev/odoo/odoo/__init__.py", line 122, in <module>
    from . import modules
  File "/Users/lawa/odoo-dev/odoo/odoo/modules/__init__.py", line 8, in <module>
    from . import db, graph, loading, migration, module, registry
  File "/Users/lawa/odoo-dev/odoo/odoo/modules/graph.py", line 10, in <module>
    import odoo.tools as tools
  File "/Users/lawa/odoo-dev/odoo/odoo/tools/__init__.py", line 13, in <module>
    from .sql import *
  File "/Users/lawa/odoo-dev/odoo/odoo/tools/sql.py", line 7, in <module>
    import psycopg2
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/__init__.py", line 50, in <module>
    from psycopg2._psycopg import (                     # noqa
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so, 2): Library not loaded: libssl.1.1.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so
  Reason: image not found

解决办法:

	brew reinstall openssl@1.1  #下载1.1新版本
	cd /usr/local/Cellar
	
	mv openssl openssl@1.0 #重命名旧版本
	mv openssl@1.1 openssl # 使用1.1
	没有安装过的话上两步可以跳过

	cd /usr/local/Cellar/openssl@1.1/1.1.1c/lib
	sudo cp libssl.1.1.dylib libcrypto.1.1.dylib /usr/local/lib/
	
	# 接下来三步不是必须的
	sudo rm libssl.dylib libcrypto.dylib
	sudo ln -s libssl.1.1.dylib libssl.dylib
	sudo ln -s libcrypto.1.1.dylib libcrypto.dylib

参考链接:
https://blog.csdn.net/ken_for_learning/article/details/97375937

你可能感兴趣的:(启动odoo出现 `Library not loaded: libssl.1.1.dylib` `Reason: image not found`报错)