1

嗨,我正在尝试使用诗歌来安装包含我的私人仓库的软件包,但它似乎不起作用。知道做错了什么吗?

[tool.poetry]
name = "aa"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.7"
package = {version = "0.1.3", source = "abc"}


[[tool.poetry.source]]
name = "abc"
url = "url"
default = true

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

我收到错误消息因为 package1 依赖于 package2 不匹配任何版本,版本解决失败但能够使用我私人仓库中的 pip 安装包

Traceback (most recent call last):
  File "/Users/abc/poetry_test/test/lib/python3.8/site-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/abc/poetry_test/test/lib/python3.8/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/abc/poetry_test/test/lib/python3.8/site-packages/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/Users/abc/poetry_test/test/lib/python3.8/site-packages/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/Users/abc/poetry_test/test/lib/python3.8/site-packages/poetry/console/commands/install.py", line 63, in handle
    return_code = installer.run()
  File "/Users/abc/poetry_test/test/lib/python3.8/site-packages/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/Users/abc/poetry_test/test/lib/python3.8/site-packages/poetry/installation/installer.py", line 225, in _do_install
    ops = solver.solve(use_latest=whitelist)
  File "/Users/abc/poetry_test/test/lib/python3.8/site-packages/poetry/puzzle/solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/Users/abc/poetry_test/test/lib/python3.8/site-packages/poetry/puzzle/solver.py", line 190, in _solve
    raise SolverProblemError(e)
4

1 回答 1

1

您将需要配置您当前的诗歌环境以使用私人存储库并在需要时通过设置您的凭据来授权您的诗歌:

poetry config repositories.abc url
# Setup credentials if needed (e.g: For private pypi repo in gitlab 
# poetry config http-basic.gitlab __token__ YOUR_PRESONAL_ACCESS_TOKEN)
于 2021-12-15T09:55:43.870 回答