Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: Couldn't load OpenSSL lib , 升级到MACOS 11.5.1后出现 #969

Closed
maoqis opened this issue Sep 9, 2021 · 5 comments
Closed

Comments

@maoqis
Copy link

maoqis commented Sep 9, 2021

Traceback (most recent call last):
File "/Users/maoqis/Documents/work/logs/bin/decode_mars_crypt_log_file.py", line 9, in
import pyelliptic
File "build/bdist.macosx-10.9-x86_64/egg/pyelliptic/init.py", line 43, in
File "build/bdist.macosx-10.9-x86_64/egg/pyelliptic/openssl.py", line 637, in
Exception: Couldn't load OpenSSL lib ...

MACOS 11.5.1
pyelliptic==1.5.10

image

python2 和3 都有该问题。

@maoqis maoqis changed the title Exception: Couldn't load OpenSSL lib Exception: Couldn't load OpenSSL lib , 升级到MACOS 11.5.1后出现 Sep 9, 2021
@zhetengxiang
Copy link

亲测可以解决问题。
mac 11.2.1 python 2.7
参考:https://github.com/Tencent/mars/issues/501解决

1、pip install https://github.com/mfranciszkiewicz/pyelliptic/archive/1.5.10.tar.gz#egg=pyelliptic
2、修改openssl.py,例如楼主位置build/bdist.macosx-10.9-x86_64/egg/pyelliptic/openssl.py

def find_crypto_lib():
    if sys.platform != 'win32':
       # 注释掉下面路径,写绝对路径
       # return ctypes.util.find_library('crypto')
       return '/usr/lib/libcrypto.dylib'

3、重新运行就不报错了

Traceback (most recent call last): File "/Users/maoqis/Documents/work/logs/bin/decode_mars_crypt_log_file.py", line 9, in import pyelliptic File "build/bdist.macosx-10.9-x86_64/egg/pyelliptic/init.py", line 43, in File "build/bdist.macosx-10.9-x86_64/egg/pyelliptic/openssl.py", line 637, in Exception: Couldn't load OpenSSL lib ...

MACOS 11.5.1 pyelliptic==1.5.10

image

python2 和3 都有该问题。

@maoqis
Copy link
Author

maoqis commented Nov 12, 2021

感谢,我试下

@maoqis maoqis closed this as completed Nov 12, 2021
@maoqis
Copy link
Author

maoqis commented Nov 12, 2021

解决了,感谢@zhetengxiang

下载 https://github.com/mfranciszkiewicz/pyelliptic/archive/1.5.10.tar.gz#egg=pyelliptic 解压,进入目录
修改 pyelliptic-1.5.10 编译前的文件,build/lib/pyelliptic/openssl.py

修改内容 如上 zhetengxiang 提供

再安装 sudo python setup.py install

@takeeasyman
Copy link

补充一下,libcrypto.dylib 路径不一定是/usr/lib/libcrypto.dylib,可能要在OpenSSL安装目录下找找,比如/usr/local/opt/openssl/lib/libcrypto.dylib

@gogi2010
Copy link

解决了,感谢@zhetengxiang

下载 https://github.com/mfranciszkiewicz/pyelliptic/archive/1.5.10.tar.gz#egg=pyelliptic 解压,进入目录 修改 pyelliptic-1.5.10 编译前的文件,build/lib/pyelliptic/openssl.py

修改内容 如上 zhetengxiang 提供

再安装 sudo python setup.py install

1、解压pyelliptic-1.5.10后要修改的文件路径是pyelliptic/openssl.py。
2、如果之前有安装过其他pyelliptic版本需要先卸载

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants