urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: un

一、背景

本人mac 环境 安装 solc-select install 0.8.1

pip install solc-selec
solc-select install 0.8.1

爆了如下错误

  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1357, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)>

二、解决办法

  • 如果您使用Linux机器,生成新证书并导出指向证书目录的环境变量来修复它。

    $ sudo update-ca-certificates --fresh
    $ export SSL_CERT_DIR=/etc/ssl/certs
    
  • Mac机器,生成新证书

    $ cd "/Applications/$(python3 --version | awk '{print $2}'| awk  -F. '{print "Python " $1"."$2}')"
    $ sudo "./Install Certificates.command"
    

你可能感兴趣的:(python报错,python)