【问题标题】:Failed to establish a new connection in wsl when i use pip install使用 pip install 时无法在 wsl 中建立新连接
【发布时间】:2023-01-18 19:17:01
【问题描述】:

我想在 Windows 11 上的 ubuntu 子系统 (WSL) 的虚拟环境中安装 flask-sqlalchemy,使用以下命令:

 pip install flask-sqlalchemy

但是我在控制台窗口中收到错误消息。

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c27dff10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c2620280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c2620520>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c26206d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ff5c2620880>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flask-sqlalchemy/
ERROR: Could not find a version that satisfies the requirement flask-sqlalchemy (from versions: none)
ERROR: No matching distribution found for flask-sqlalchemy  

我认为这与我的 Ubuntu 子系统中的网络连接有关。我尝试在 Standalone Linux 系统上运行,它似乎可以工作。我该如何解决这个问题?

【问题讨论】:

    标签: python pip windows-subsystem-for-linux


    【解决方案1】:

    您可以尝试使用以下命令吗:

    pip 安装 Flask-SQLAlchemy

    还要确保升级你的 pip 版本:

    pip install --upgrade pip
    

    您也可以参考here了解更多详情

    【讨论】:

      猜你喜欢
      • 2020-05-09
      • 1970-01-01
      • 1970-01-01
      • 2019-05-30
      • 1970-01-01
      • 2015-07-24
      • 2014-02-12
      • 2020-09-14
      • 2016-02-22
      相关资源
      最近更新 更多