【问题标题】:Warning in command prompt while installing pip安装 pip 时命令提示符中的警告
【发布时间】:2022-12-11 10:32:04
【问题描述】:

警告:重试(重试(total=4,connect=None,read=None,redirect=None,status=None))连接被'ReadTimeoutError(“HTTPSConnectionPool(host='pypi.org',port=443)打破):读取超时。(读取超时=15)")': /simple/pip/

我试图谷歌它但没有解决方案

【问题讨论】:

  • 你是用 pip 安装 pip 还是什么?看起来像是网络问题。试试ping pypi.python.org

标签: python pip command-prompt


【解决方案1】:

您用于安装的命令是什么? 你试过这些命令了吗?

sudo apt install python3-pip
python3 -m pip install --upgrade pip setuptools wheel

【讨论】:

    【解决方案2】:

    这可能有多种原因。

    如果您在使用代理服务器进行出站连接的公司设置中,请尝试以下操作:

    为代理设置环境变量。

    视窗:

    set http_proxy=http://user:password@proxyserver:port
    set https_proxy=http://user:password@proxyserver:port
    

    苹果电脑/Linux:

    export http_proxy=http://user:password@proxyserver:port
    export https_proxy=http://user:password@proxyserver:port
    

    或者在 pip install 命令中明确使用代理:

    pip install --upgrade pip --trusted-host pypi.org --proxy http://user:password@proxyserver:port
    pip install --upgrade <pakcage-name> --trusted-host pypi.org --proxy http://user:password@proxyserver:port
    

    或者您可以为您的组织设置或使用 python 包安装的工件:

    pip install --upgrade pip --trusted-host <artifactory-host-name> --index-url <artifactory-url>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-03
      • 2020-10-17
      • 2021-09-06
      • 1970-01-01
      • 1970-01-01
      • 2019-05-11
      • 2019-05-28
      • 1970-01-01
      相关资源
      最近更新 更多