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

前端 未结 11 1863
臣服心动
臣服心动 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: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.

提交回复
热议问题