美文网首页
python pip install报错 unable to g

python pip install报错 unable to g

作者: michaelxwang | 来源:发表于2023-11-23 14:03 被阅读0次

    本质是ssl证书认证失败。我们需要访问的是http的链接,但是访问https:的了,所以访问失败。

    报错信息

    Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1125)’))) - skipping

    解决方案

    直接设置global的配置,即到C:/ProgramData下创建pip文件夹,新建pip.ini
    查看pip global路径

    pip -v config list
    
    image.png

    新建文件夹以及pip.ini文件

    image.png

    放入信任地址

    [global]
    trusted-host = pypi.python.org
                   pypi.org
                   files.pythonhosted.org
                   pypi.douban.com
                   mirrors.tuna.tsinghua.edu.cn
                   mirrors.aliyun.com
    
    image.png

    参考:官网 https://pip.pypa.io/en/latest/topics/configuration/

    相关文章

      网友评论

          本文标题:python pip install报错 unable to g

          本文链接:https://www.haomeiwen.com/subject/ygcgwdtx.html