“ERROR:root:code for hash md5 was not found” when using any hg mercurial commands

前端 未结 11 1829
臣服心动
臣服心动 2020-12-02 04:05

When trying to use any hg Mercurial commands on the console, I keep getting this error. I installed Python using Homebrew and I am running Mac OS Catalina v. 1

相关标签:
11条回答
  • 2020-12-02 04:43

    Just uninstall python2

    $ brew uninstall python@2

    If there is any error :

    $ brew uninstall --ignore-dependencies python@2

    0 讨论(0)
  • 2020-12-02 04:45

    The case for me is that when I install dependencies of a django web app, it messes up the environment. When I type cd, it shows the same error.

    The problem was the openssl library, it can not find the correct ones.

    If you are on Macintosh, you can type

    ls /usr/local/Cellar/openssl

    to see all the versions,

    brew switch openssl 1.0.XXXX

    to choose the available openssl version.

    Then the error is gone :)

    0 讨论(0)
  • 2020-12-02 04:51

    Running brew reinstall python@2 didn't work for my existing Python 2.7 virtual environments. Inside them there were still ERROR:root:code for hash sha1 was not found errors.

    I encountered this problem after I ran brew upgrade openssl. And here's the fix:

    $ ls /usr/local/Cellar/openssl
    

    ...which shows

    1.0.2t
    

    According to the existing version, run:

    $ brew switch openssl 1.0.2t
    

    ...which shows

    Cleaning /usr/local/Cellar/openssl/1.0.2t
    Opt link created for /usr/local/Cellar/openssl/1.0.2t
    

    After that, run the following command in a Python 2.7 virtualenv:

    (my-venv) $ python -c "import hashlib;m=hashlib.md5();print(m.hexdigest())"
    

    ...which shows

    d41d8cd98f00b204e9800998ecf8427e
    

    No more errors.

    0 讨论(0)
  • 2020-12-02 04:52

    The next solution worked for me on MacOS Catalina:

    1. Unlink openssl
    brew unlink openssl
    
    1. Reinstall python 2.7 (removed from homebrew and can't be installed via brew install python@2)
    brew tap-new <user>/homebrew-python2
    brew extract python@2 <user>/homebrew-python2
    brew reinstall /usr/local/Homebrew/Library/Taps/<user>/homebrew-python2/Formula/python@2.7.17.rbl
    
    0 讨论(0)
  • 2020-12-02 04:53

    After installing openssl I got the same problem. This answer didn't help me, but after manual linking of libcrypto.1.1.dylib and libssl.1.1.dylib everything start working. In my case it was:

    ln -s /usr/local/opt/openssl/lib/libcrypto.1.1.dylib /usr/local/lib
    ln -s /usr/local/opt/openssl/lib/libssl.1.1.dylib /usr/local/lib
    
    0 讨论(0)
  • 2020-12-02 04:56

    My problem was multiple versions of python installed (python was still aliased to python2 but i wanted pip to use python3). i also have a python3 bin installed on my system

    # use pip with python3
    $ python3 -m pip install fish
    

    see Dealing with multiple Python versions and PIP? for details

    0 讨论(0)
提交回复
热议问题