无法在 python 3.7 中导入 aerospike

raj*_*wal 3 python-3.x aerospike

我在使用 pip 下载 aerospike 后尝试导入它,但出现此错误。我尝试使用自制软件和图形安装程序重新安装 python,但结果是一样的。我可以导入其他包,例如 numpy。

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python3.7/site-packages/aerospike.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/lib/python3.7/site-packages/aerospike.cpython-37m-darwin.so
  Reason: image not found
Run Code Online (Sandbox Code Playgroud)

Pra*_*ara 7

在 OSX Catalina 上,默认的 openssl 安装存在一些问题。请按照以下步骤操作。

brew update && brew upgrade
brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
Run Code Online (Sandbox Code Playgroud)

更多细节在这里 - https://github.com/kelaberetiv/TagUI/issues/86


D.W*_*D.W 6

由于缺少 openssl 依赖项,Aerospike python 客户端很可能在导入时失败。

我建议安装 openssl

brew install openssl
Run Code Online (Sandbox Code Playgroud)

然后重新安装python客户端。

pip install aerospike --force-reinstall
Run Code Online (Sandbox Code Playgroud)

否则,您可以按照此处的 OSX 构建说明进行操作。https://github.com/aerospike/aerospike-client-python/blob/master/BUILD.md#os-x

希望这可以帮助。