python-3.x 诗歌安装- ConnectionError|无法建立新连接:[错误101]网络无法访问'

kg7wmglp  于 2023-05-19  发布在  Python
关注(0)|答案(3)|浏览(312)

我使用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│

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

5n0oy7gb

5n0oy7gb1#

我做到了:

  • poetry self update 1.0.10
  • poetry install

终端现在正在给我安装,因为它应该。

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)
  ...
n7taea2i

n7taea2i2#

我有同样的问题,它原来是连接被服务器拒绝,由于超过最大连接限制的镜像存储。
默认情况下,poetry``installer.max-workers设置为number_of_cores + 4。这将是一个问题,当你运行诗歌的服务器上有24个核心,这是合理的服务器端拒绝许多连接。
解决方法是在执行poetry install之前手动配置此值,您可以使用以下命令来限制最大连接数:

poetry config installer.max-workers 4
llycmphe

llycmphe3#

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

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"

相关问题