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

时间:2019-11-27 10:55:19

标签: python cassandra cqlsh

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

  os        : mac  
  cassandra : apache-cassandra-3.9   
  python    :2.7.16  
  jave .    : 1.8 
cqlsh 
$ cqlsh
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.

3 个答案:

答案 0 :(得分:1)

重新安装python 2.7可以帮助我解决此问题

  

重新安装python @ 2

答案 1 :(得分:0)

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

brew install openssl

答案 2 :(得分:0)

该错误是由于通过brew安装的python(可能是某些依赖项问题)引起的。 我已经完成以下步骤

1)brew卸载--ignore-dependencies python @ 2
2)从https://www.python.org/getit/

安装python

由mihgen在下面的github参考链接上建议的以下4个步骤
1)brew install openssl
2)brew链接openssl --force
3)brew卸载python
4)brew安装python --with-brewed-openssl

引用:https://github.com/Homebrew/legacy-homebrew/issues/22816