MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

Resolving dependencies failed when using poetry

Open LAD021 opened this issue 1 year ago • 9 comments
trafficstars

Seems like metagpt requires qdrant-client == 1.7.0, numpy == 1.24.3, while qdant-client requires numpy >=1.26 image Here is my pyproject.toml image

Maybe we can follow what langchain does, to isolate third-party dependencies like pip install langchain-openai

LAD021 avatar Apr 14 '24 04:04 LAD021

Qdrant is not in use, may be removed in the future. FYI: related issue.

seehi avatar Apr 15 '24 02:04 seehi

Qdrant is not in use, may be removed in the future. FYI: related issue.

It seems this lib belongs to an example, may be we can isolate the libs required by examples or specified tools (like search api) from main dependencies.

LAD021 avatar Apr 15 '24 02:04 LAD021

I also encounter the same issue when trying to bring in MetaGPT as a dependency. The issue here is that purely using requirements.txt does not properly check dependency compatibility across packages (as is evident in this case).

The other issue is the practice of locking popular python packages (such as pydantic) down to a specific version, as opposed to a compatible version range. This severely limits the ability to bring in other 3rd party libraries which also rely on these dependencies.

For example if we were to look to langchain for how to best go about things:

numpy = "^1"
pydantic = ">=1,<3"

as compared to being locked down to specific versions as is the case in the current requirements.txt:

numpy==1.24.3
pydantic==2.5.3

[!NOTE] The original issue has been present since v0.7.1.

kilesk avatar Apr 22 '24 12:04 kilesk

What about using poetry or rye as a package management tool?

LAD021 avatar Apr 23 '24 02:04 LAD021

@seehi

geekan avatar Apr 23 '24 03:04 geekan

What about using poetry or rye as a package management tool?

I'd definitely recommend poetry as a candidate, its what I use currently and it seems to be used a fair bit nowadays.

kilesk avatar Apr 23 '24 05:04 kilesk

Has this issue been resolved? I meet the same issue when install the lastest 0.8.1 with poetry.

Because qdrant-client (1.7.0) depends on numpy (>=1.26)
 and metagpt (0.8.0) depends on numpy (1.24.3), qdrant-client (1.7.0) is incompatible with metagpt (0.8.0).
So, because metagpt-startup depends on metagpt (0.8.0) which depends on qdrant-client (1.7.0), version solving failed.

liushuaikobe avatar Apr 23 '24 07:04 liushuaikobe

I had to use pip and python 3.9. Even had issues installing with 3.12 & pip. qdrant-client was blocking any variation when trying to poetry install.

michael-hedgineer avatar Apr 29 '24 19:04 michael-hedgineer

For now, temporary solution would be poetry add git+https://github.com/geekan/MetaGPT.git.

Umpire2018 avatar May 08 '24 03:05 Umpire2018