诗歌安装 - ConnectionError |建立新连接失败:[Errno 101] 网络不可达'

问题描述 投票:0回答:3

我正在使用

Poetry version 1.1.7
.

运行

poetry install
会产生此错误。

这可以通过 bash 解决吗?或者这是否明确与我的网络有关?注意:互联网连接在浏览器中非常好。

me@LAPTOP-G1DAPU88:~/.ssh/workers-python/workers/CompositeKey/CompositeKey$ poetry install
Updating dependencies
Resolving dependencies... (225.5s)

  ConnectionError

  HTTPSConnectionPool(host='pkgs.dev.azure.com', port=443): Max retries exceeded with url: <CENSORED> (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f53950c3ee0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

  at ~/.poetry/lib/poetry/_vendor/py3.8/requests/adapters.py:516 in send
      512│             if isinstance(e.reason, _SSLError):
      513│                 # This branch is for urllib3 v1.22 and later.
      514│                 raise SSLError(e, request=request)
      515│ 
    → 516│             raise ConnectionError(e, request=request)
      517│ 
      518│         except ClosedPoolError as e:
      519│             raise ConnectionError(e, request=request)
      520│ 

A

401 Unauthorized Error
将 URL 粘贴到我的浏览器时抛出。

python-3.x connection connection-pooling urllib3 python-poetry
3个回答
3
投票

我做了:

  • poetry self update 1.0.10
  • poetry install

Terminal 现在正在给我安装,这是应该的。

me@LAPTOP-G1DAPU88:~/.ssh/workers-python/workers/CompositeKey/CompositeKey$ poetry self update 1.0.10
Updating to 1.0.10
 - Downloading poetry-1.0.10-linux.tar.gz 100%

Poetry (1.0.10) is installed now. Great!
me@LAPTOP-G1DAPU88:~/.ssh/workers-python/workers/CompositeKey/CompositeKey$ poetry install
Updating dependencies
Resolving dependencies... (101.5s)

Writing lock file


Package operations: 167 installs, 0 updates, 0 removals

  - Installing six (1.16.0)
  ...

1
投票

我有同样的问题,结果是由于超过镜像仓库的最大连接限制而被服务器拒绝连接。

默认情况下

poetry
的最大值
installer.max-workers
设置为
number_of_cores + 4
。当您在具有 24 个内核的服务器上运行诗歌时,这将是一个问题,并且服务器端拒绝那么多连接是合理的。

解决方法是在执行

poetry install
之前手动配置此值,您可以使用以下命令来限制最大连接数:

poetry config installer.max-workers 4

0
投票

如果这里有人正在寻找这个问题的解决方案:

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fa0c6e47510>: Failed to establish a new connection: [Errno 110] Connection timed out')'

您可以尝试将

poetry
版本更改为
1.1.8
并添加设置到
pyproject.toml

[build-system]
requires = ["poetry>=1.1.1", "setuptools", "cython"]
build-backend = "poetry.masonry.api"
© www.soinside.com 2019 - 2024. All rights reserved.