问题描述
(poetry-test-py3.12) ➜ poetry-test poetry lock
Updating dependencies
Resolving dependencies... (0.6s)
Because llama-index (0.10.50) depends on llama-index-core (0.10.50)
and no versions of llama-index match >0.10.50,<0.11.0, llama-index (>=0.10.50,<0.11.0) requires llama-index-core (0.10.50).
So, because poetry-test depends on both llama-index (^0.10.50) and llama-index-core (^0.10.50.post1), version solving failed.
(poetry-test-py3.12) ➜ poetry-test
版本
0.10.50.post1
重现步骤
使用这个 pyproject.toml (使用 poetry init
生成)
(poetry-test-py3.12) ➜ poetry-test cat pyproject.toml
[tool.poetry]
name = "poetry-test"
version = "0.1.0"
description = ""
authors = ["Yi"]
readme = "README.md"
package-mode = false
[tool.poetry.dependencies]
python = "^3.12"
llama-index = "^0.10.50"
llama-index-core = "^0.10.50.post1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
相关日志/回溯
- 无响应*
3条答案
按热度按时间dldeef671#
要解决在运行
poetry lock
时,llama-index
和llama-index-core
之间的版本不兼容问题,您需要确保pyproject.toml
文件中指定的依赖项彼此兼容。以下是逐步的方法:llama-index
依赖项:确保llama-index
中的依赖项与llama-index-core
中的依赖项不冲突。llama-index
和llama-index-core
之间共享依赖项的版本是一致的。pyproject.toml
:修改llama-index
的pyproject.toml
文件,使其与llama-index-core
中指定的版本相匹配。以下是如何为
llama-index
更新pyproject.toml
文件的示例:通过确保
llama-index
和llama-index-core
之间的依赖项及其版本保持一致,您应该能够在运行poetry lock
1(https://github.com/run-llama/llama_index/blob/main/llama-index-core/pyproject.toml)2(https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/readers/llama-index-readers-readme/pyproject.toml) 时解决版本不兼容问题。zsohkypk2#
显然,如果我从pyproject.toml中移除llama-index-core,poetry会很开心,但是它将拒绝安装核心的最新修复版本。
nwsw7zdq3#
是的,
llama-index
与core
的具体版本相关联,以帮助在llama-index
级别进行升级和降级。这里的权衡是你所遇到的问题。明天可能会有一个新的发布,然后你将获得最新版本:)