So I'm trying to install pip on my macOS and when I'm running sudo python get-pip.py
command and I'm getting the following error:
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.
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 sha256
ERROR:root:code for hash sha384 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 sha384
ERROR:root:code for hash sha512 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 sha512
Traceback (most recent call last):
File "get-pip.py", line 23704, in <module>
main()
File "get-pip.py", line 198, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 83, in bootstrap
from pip._internal.commands.install import InstallCommand
File "/var/folders/l8/m4y81mrx6x37cslmws_mg91c0000gn/T/tmphs0wnS/pip.zip/pip/_internal/commands/install.py", line 17, in <module>
File "/var/folders/l8/m4y81mrx6x37cslmws_mg91c0000gn/T/tmphs0wnS/pip.zip/pip/_internal/cli/req_command.py", line 16, in <module>
File "/var/folders/l8/m4y81mrx6x37cslmws_mg91c0000gn/T/tmphs0wnS/pip.zip/pip/_internal/index/collector.py", line 14, in <module>
File "/var/folders/l8/m4y81mrx6x37cslmws_mg91c0000gn/T/tmphs0wnS/pip.zip/pip/_vendor/requests/__init__.py", line 43, in <module>
File "/var/folders/l8/m4y81mrx6x37cslmws_mg91c0000gn/T/tmphs0wnS/pip.zip/pip/_vendor/urllib3/__init__.py", line 7, in <module>
File "/var/folders/l8/m4y81mrx6x37cslmws_mg91c0000gn/T/tmphs0wnS/pip.zip/pip/_vendor/urllib3/connectionpool.py", line 29, in <module>
File "/var/folders/l8/m4y81mrx6x37cslmws_mg91c0000gn/T/tmphs0wnS/pip.zip/pip/_vendor/urllib3/connection.py", line 41, in <module>
File "/var/folders/l8/m4y81mrx6x37cslmws_mg91c0000gn/T/tmphs0wnS/pip.zip/pip/_vendor/urllib3/util/__init__.py", line 7, in <module>
File "/var/folders/l8/m4y81mrx6x37cslmws_mg91c0000gn/T/tmphs0wnS/pip.zip/pip/_vendor/urllib3/util/ssl_.py", line 8, in <module>
ImportError: cannot import name md5
I had a look at this answer, which talks about the same problem but the author faced this problem while using AWS and here in my case I'm using my local system, thus not able to take any help from that answer. Any help would be highly appreciated. Thanks!