繁体   English   中英

使用 pyproject.toml 文件从私人仓库安装 python 诗歌

[英]python poetry installing from private repo using pyproject.toml file

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

[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)

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

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)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM