Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash md5 error on Mac #540

Closed
thundertrick opened this issue Jun 13, 2018 · 34 comments
Closed

hash md5 error on Mac #540

thundertrick opened this issue Jun 13, 2018 · 34 comments

Comments

@thundertrick
Copy link

thundertrick commented Jun 13, 2018

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
Copy link
Author

thundertrick commented Jun 14, 2018

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
Copy link
Owner

wting commented Sep 6, 2018

Thanks for sharing the root cause.

@sivan
Copy link

sivan commented Dec 4, 2019

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

kynetiv commented Dec 13, 2019

This fixed it for me: brew reinstall python@2

@liuzoxan
Copy link

This fixed it for me: brew reinstall python@2

Thank you!

@stormgbs
Copy link

This fixed it for me: brew reinstall python@2

Thanks, worked for me!

@dogui1718
Copy link

This fixed it for me: brew reinstall python@2

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

@HSHPANDEY
Copy link

why did reinstalling python worked!

@HuangHongRui
Copy link

因为俺使用的是:pyenv.

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

@AC52704
Copy link

AC52704 commented Jan 10, 2020

This fixed it for me: brew reinstall python@2

Worked for me as well, Gracias!!

@talpenguin
Copy link

This fixed it for me: brew reinstall python@2

worked for me too! Thanks!

@lylehust
Copy link

This fixed it for me: brew reinstall python@2

Fixed. Thank you.

@floswald
Copy link

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

AngusY commented Feb 13, 2020

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

slixurd commented Feb 13, 2020

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

@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
Copy link

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

@slixurd
Copy link

slixurd commented Feb 14, 2020

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

whosphp commented Feb 19, 2020

@slixurd Thanks

@jeffreydking
Copy link

@slixurd Worked for me. Thanks!

@rafalskyi
Copy link

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

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

@slixurd
Worked for me. Thank you! 😀

@rock288
Copy link

rock288 commented Mar 15, 2020

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

8eecf0d2 commented Apr 4, 2020

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

tiboprea commented Apr 5, 2020

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

rns4731 commented Apr 20, 2020

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

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

gb8may commented Apr 25, 2020

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

wadee commented May 12, 2020

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

ICeZer0 commented Jun 11, 2020

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. Homebrew/homebrew-core#49796
brew upgrade python@2 works.

@Ib467
Copy link

Ib467 commented Sep 11, 2020

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests