• pip安装包出现timeout的解决办法


    pip安装包出现timeout的解决办法

     

    今天安装django时老是出现timeout

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after conn
    ection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object
    at 0x00000000044BC9B0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/diango/

    解决的方法

    1.设置超时时间

    pip --default-timeout=1000 install  django

    2.切换国内的镜像源

    (1)临时修改

      使用pip的时候在后面加上-i参数,指定pip源 

    eg:  

    pip install -i https://pypi.douban.com/simple django

    (2)永久修改

    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

    pip.ini的内容

    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple

    常用的镜像源

    阿里云:https://mirrors.aliyun.com/pypi/simple/
    中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/
    清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
    豆瓣:http://pypi.douban.com/simple/
  • 相关阅读:
    分布式事务
    K8s应用案例介绍——阿里云
    数据库索引的底层原理——b树
    Understanding the GitHub flow
    Code Review
    详解微服务架构
    yarn之package.json
    yarn.lock文件
    Git Api——git开发
    Unit Test —— xUnit.net
  • 原文地址:https://www.cnblogs.com/tuobei/p/12496279.html
Copyright © 2020-2023  润新知