AWS CLI : 오류 : 해시 md5에 대한 루트 : 코드를 찾을 수 없습니다


13

AWS CLI를 실행하려고하면 다음 오류가 발생합니다.

aws
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/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.15_1/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.15_1/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.15_1/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.15_1/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.15_1/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.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/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.15_1/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 sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/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.15_1/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 sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/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.15_1/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 sha512
Traceback (most recent call last):
  File "/usr/local/bin/aws", line 19, in <module>
    import awscli.clidriver
  File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in <module>
    import botocore.session
  File "/usr/local/lib/python2.7/site-packages/botocore/session.py", line 29, in <module>
    import botocore.configloader
  File "/usr/local/lib/python2.7/site-packages/botocore/configloader.py", line 19, in <module>
    from botocore.compat import six
  File "/usr/local/lib/python2.7/site-packages/botocore/compat.py", line 25, in <module>
    from botocore.exceptions import MD5UnavailableError
  File "/usr/local/lib/python2.7/site-packages/botocore/exceptions.py", line 15, in <module>
    from botocore.vendored import requests
  File "/usr/local/lib/python2.7/site-packages/botocore/vendored/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/usr/local/lib/python2.7/site-packages/botocore/vendored/requests/utils.py", line 26, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/usr/local/lib/python2.7/site-packages/botocore/vendored/requests/compat.py", line 7, in <module>
    from .packages import chardet
  File "/usr/local/lib/python2.7/site-packages/botocore/vendored/requests/packages/__init__.py", line 3, in <module>
    from . import urllib3
  File "/usr/local/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/__init__.py", line 10, in <module>
    from .connectionpool import (
  File "/usr/local/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py", line 31, in <module>
    from .connection import (
  File "/usr/local/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/connection.py", line 45, in <module>
    from .util.ssl_ import (
  File "/usr/local/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/util/__init__.py", line 5, in <module>
    from .ssl_ import (
  File "/usr/local/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/util/ssl_.py", line 2, in <module>
    from hashlib import md5, sha1, sha256
ImportError: cannot import name md5

이 문제 에서 해결책을 시도했지만 작동하지 않습니다.

brew reinstall python@2
==> Reinstalling python@2
Error: An exception occurred within a child process:
  FormulaUnavailableError: No available formula with the name "/usr/local/opt/python@2/.brew/python@2.rb"

설치되지 않았을 수도 있지만 이미 다음과 같습니다.

brew install python@2
Warning: python@2 2.7.15_1 is already installed and up-to-date
To reinstall 2.7.15_1, run `brew reinstall python@2`

실행 brew doctor프로그램 python좋아요 표시되어 있지만 실행하는 brew link python때문에에 속하는 심볼릭 링크 실패합니다 python@2.

brew link python
Linking /usr/local/Cellar/python/3.7.6_1...
Error: Could not symlink Frameworks/Python.framework/Headers
Target /usr/local/Frameworks/Python.framework/Headers
is a symlink belonging to python@2. You can unlink it:
  brew unlink python@2

To force the link and overwrite all conflicting files:
  brew link --overwrite python

To list all files that would be deleted:
  brew link --overwrite --dry-run python

권장되는 명령은 원으로 표시되는 것으로 보이지만 문제를 해결할 수있는 명령은 없습니다. 조금 멈췄습니다.이 오류를 어떻게 복구합니까?


나는 당신이 당신의 시스템에서 해당 버전을 제거하고 새로운 AWS CLI 파이썬과 같은 의존성을 방지하기 위해 번들 패키지로 제공되는 v2를 다운로드하는 것이 좋습니다
eez0을

@ eez0 시도해 볼 수 있지만 같은 문제로 실행됩니다.pip uninstall awscli ERROR:root:code for hash md5 was not found.
Pauline

1
시도brew reinstall awscli
Doyin Olarewaju

답변:


11

pip를 사용하려고 할 때 brew install python2 오류와 비슷한 문제가 발생했습니다.

아마

커밋 028f11f9e에서 python @ 2가 homebrew / core에서 삭제되었습니다.
python @ 2 : delete ( https://github.com/Homebrew/homebrew-core/issues/49796 )
2020 년 1 월 1 일 EOL.

자세한 내용은 https://github.com/Homebrew/homebrew-core/pull/49796 을 참조하십시오.

이 문제를 해결하려면

  1. brew uninstall python@2brew installed python @ 2를 제거하기 위해 실행 하면 기본 python2가 python2로 폴백해야 macOS가 제공됩니다.
  2. 다음을 실행하여 현재 AWS CLI 제거

    • sudo rm -rf /usr/local/bin/aws
    • sudo rm -rf /usr/local/aws
    • rm AWSCLIV2.pkg
  3. 다음을 실행하여 aws cli를 다시 설치하십시오.

    • sudo curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
    • sudo installer -pkg AWSCLIV2.pkg -target /
  4. 실행 aws --version하면이 python3대신에 연결되어 python2있습니다.

도움이 되길 바랍니다.


그냥 실행 brew uninstall python@2, 나를 위해 일한 덕분에
다니엘 고메즈 리코

brew uninstall python @ 2도 저를 위해 일했습니다. 고마워요 :-)
Aditya Rao

0

나는 실행 후 같은 문제가 있었다 brew install imagemagick.

모두 autojumpawscli오류 위의 준.

이 문제는 opensslhomebrew와 macOS SSL lib가 설치 한 것 사이의 충돌로 인해 발생 합니까? 여기여기를 참조 하십시오

명령을 실행하면 아래에 고정 나를 위해 그것을

brew reinstall python@2
brew reinstall awscli
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.