wting / autojump

A cd command that learns - easily navigate directories from the command line
Other
16.3k stars 706 forks source link

hash md5 error on Mac #540

Closed thundertrick closed 6 years ago

thundertrick commented 6 years ago

I install autojump and it works quite well until today. Every time I open a directory a mass of python error msg is printed to the terminal. I install buck and watchman with homebrew today.

If I uninstall autojump, the error msg dismiss. Is there any way to fix it?


The detail of error msg is as following:

ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.15/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 /Users/huxuyang/dev/BeautyCamera ➜ BeautyCamera git:(feature-v1.7.7) ✗ ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15/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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.15/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

thundertrick commented 6 years ago

The reason seems to be OS X use ssl lib of its own instead of openssl. Thus if we brew install openssl, the two lib conflict. Walk around can be found here: https://github.com/dotnet/cli/issues/3964#issuecomment-236493536

This issue can be close now, thanks.

wting commented 6 years ago

Thanks for sharing the root cause.

sivan commented 5 years ago

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 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 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 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 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 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 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

Same issue, works after removing python@2 brew uninstall python@2.

kynetiv commented 4 years ago

This fixed it for me: brew reinstall python@2

liuzoxan commented 4 years ago

This fixed it for me: brew reinstall python@2

Thank you!

stormgbs commented 4 years ago

This fixed it for me: brew reinstall python@2

Thanks, worked for me!

dogui1718 commented 4 years ago

This fixed it for me: brew reinstall python@2

Thanks, worked for me too! Happy New Year 2020!!!

HSHPANDEY commented 4 years ago

why did reinstalling python worked!

HuangHongRui commented 4 years ago

因为俺使用的是:pyenv.

所以使用 pyenv install -f 2.7.17 来解决我的问题

AC52704 commented 4 years ago

This fixed it for me: brew reinstall python@2

Worked for me as well, Gracias!!

talpenguin commented 4 years ago

This fixed it for me: brew reinstall python@2

worked for me too! Thanks!

lylehust commented 4 years ago

This fixed it for me: brew reinstall python@2

Fixed. Thank you.

floswald commented 4 years ago

not for me?

➜  LandUse git:(country) ✗ 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" 
AngusY commented 4 years ago

Same here:

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

slixurd commented 4 years ago

Same here:

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

save the file as python@2.rb in your OSX

https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python%402.rb

then

brew reinstall python@2.rb

It works for me to resolve the error "ERROR:root:code for hash md5 was not found.". Just a little confuse to brew version control.

chrisnankervis commented 4 years ago

@slixurd your solution worked for me as well, thank you!

I also learned that you can install a package via brew from a file, nifty solution 👍

floswald commented 4 years ago

sorry @slixurd @chrisnankervis where exactly do i have to save that ruby script you link to above on my computer? thanks

slixurd commented 4 years ago

sorry @slixurd @chrisnankervis where exactly do i have to save that ruby script you link to above on my computer? thanks

any place. just run the command brew reinstall python@2.rb in the same directory.

whosphp commented 4 years ago

@slixurd Thanks

jeffreydking commented 4 years ago

@slixurd Worked for me. Thanks!

rafalskyi commented 4 years ago

Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "/usr/local/Cellar/python@2/2.7.15_1/.brew/python@2.rb"

blizard863 commented 4 years ago

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 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 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 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 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 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 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

Same issue, works after removing python@2 brew uninstall python@2.

yes , it worked for me, 3q

Aronyu127 commented 4 years ago

@slixurd Worked for me. Thank you! 😀

rock288 commented 4 years ago

brew reinstall python@2.rb Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "/usr/local/Cellar/python@2/2.7.15_1/.brew/python@2.rb"

8eecf0d2 commented 4 years ago

brew reinstall python@2.rb Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "/usr/local/Cellar/python@2/2.7.15_1/.brew/python@2.rb"

Are you sure python@2.rb is in your current directory?

Maybe try reinstalling directly from the URL.

brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python@2.rb
tiboprea commented 4 years ago

brew reinstall python@2.rb Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "/usr/local/Cellar/python@2/2.7.15_1/.brew/python@2.rb"

Are you sure python@2.rb is in your current directory?

Maybe try reinstalling directly from the URL.

brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python@2.rb

Worked. Thank you very much!

rns4731 commented 4 years ago

brew reinstall python@2.rb Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "/usr/local/Cellar/python@2/2.7.15_1/.brew/python@2.rb"

Are you sure python@2.rb is in your current directory?

Maybe try reinstalling directly from the URL.

brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python@2.rb

This was a huge problem for me and it worked! Thank you.

hugotavares commented 4 years ago

brew reinstall python@2.rb Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "/usr/local/Cellar/python@2/2.7.15_1/.brew/python@2.rb"

Are you sure python@2.rb is in your current directory?

Maybe try reinstalling directly from the URL.

brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python@2.rb

Worked like a charm! Thank you so much!

gb8may commented 4 years ago

brew reinstall python@2.rb Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "/usr/local/Cellar/python@2/2.7.15_1/.brew/python@2.rb"

Are you sure python@2.rb is in your current directory?

Maybe try reinstalling directly from the URL.

brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python@2.rb

Worked for me: brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python@2.rb

Thanks!

wadee commented 4 years ago

brew reinstall python@2.rb Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "/usr/local/Cellar/python@2/2.7.15_1/.brew/python@2.rb"

Are you sure python@2.rb is in your current directory?

Maybe try reinstalling directly from the URL.

brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python@2.rb

such a good job! Thanks!

ICeZer0 commented 4 years ago

brew reinstall python@2.rb Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "/usr/local/Cellar/python@2/2.7.15_1/.brew/python@2.rb"

Are you sure python@2.rb is in your current directory? Maybe try reinstalling directly from the URL.

brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python@2.rb

such a good job! Thanks!

The PR was merged. https://github.com/Homebrew/homebrew-core/pull/49796 brew upgrade python@2 works.

Ib467 commented 4 years ago

Workaround for error installing openvFor Mac - $ Python macbookpro$ pip install opencv-python ERROR:root:code for hash md5 was not found.

Try these steps:

$brew switch openssl 1.0.2r

then activate your environment and try $ python -c "import hashlib;m=hashlib.md5();print(m.hexdigest())"

Then pip install opencv-python

vikas027 commented 4 years ago

Reinstall and upgrade failed for me

✦ ❯ brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python@2.rb
Error: Calling Installation of python@2 from a GitHub commit URL is disabled! Use 'brew extract python@2' to stable tap on GitHub instead.

✦ ❯ brew upgrade python@2
Warning: python@2 2.7.17_1 already installed
~

Only this which has worked for me on Catalina is this

$ brew tap-new <user>/homebrew-python2
$ brew extract python@2 <user>/homebrew-python2
$ brew install /usr/local/Homebrew/Library/Taps/<user>/homebrew-python2/Formula/python@2.7.17.rb
debodirno commented 4 years ago

Same here:

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

save the file as python@2.rb in your OSX

https://raw.githubusercontent.com/Homebrew/homebrew-core/94d572a132a63651739fef1931f540404b7eaa31/Formula/python%402.rb

then

brew reinstall python@2.rb

It works for me to resolve the error "ERROR:root:code for hash md5 was not found.". Just a little confuse to brew version control.

Thanks! Worked for me. I was using virtual environments. So had to link python and pip back to /usr/local/bin/python and /usr/local/bin/pip.

$ ln -sf /usr/local/bin/python  ~/python_envs/env27/bin/python
$ ln -sf /usr/local/bin/pip  ~/python_envs/env27/bin/pip