cqlsh 错误:root:未找到哈希 md5 的代码

nag*_*tod 6 python cassandra cqlsh

我无法在 mac 上使用 cqlsh。下面是我得到的系统信息和错误日志。

  os        : mac  
  cassandra : apache-cassandra-3.9   
  python    :2.7.16  
  jave .    : 1.8 
Run Code Online (Sandbox Code Playgroud)
cqlsh 
$ cqlsh
Run Code Online (Sandbox Code Playgroud)
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Run Code Online (Sandbox Code Playgroud)

Unm*_*esh 8

重新安装 python 2.7 帮助我解决了这个问题

brew 重新安装 python@2


Aar*_*ron 1

我认为它依赖于 MD5、SHA1 等的 OpenSSL 库。尝试安装 OpenSSL 一次:

brew install openssl
Run Code Online (Sandbox Code Playgroud)