joshpxyne / gpt-migrate

Easily migrate your codebase from one framework or language to another.
https://gpt-migrate.com
MIT License
6.85k stars 485 forks source link

Confused about dependency handling #45

Open Koeng101 opened 10 months ago

Koeng101 commented 10 months ago

Why is both poetry and pip used? Shouldn't dependencies be handled by poetry, then after poetry install run with poetry run python main.py?

When I do try that, I get the error of no litellm, but when I try to add it, I get:

Because no versions of litellm match >1.7.12,<2.0.0
 and litellm (1.7.12) depends on openai (>=1.0.0), litellm (>=1.7.12,<2.0.0) requires openai (>=1.0.0).
So, because gpt-migrate depends on both openai (^0.27.8) and litellm (^1.7.12), version solving failed.

When I do use pip for installing the dependencies, I get the following error:

Traceback (most recent call last):
  File "/Users/koeng/py/src/github.com/joshpxyne/gpt-migrate/gpt_migrate/main.py", line 7, in <module>
    from ai import AI
  File "/Users/koeng/py/src/github.com/joshpxyne/gpt-migrate/gpt_migrate/ai.py", line 6, in <module>
    from litellm import completion
  File "/opt/homebrew/lib/python3.11/site-packages/litellm/__init__.py", line 28, in <module>
    from .timeout import timeout
  File "/opt/homebrew/lib/python3.11/site-packages/litellm/timeout.py", line 11, in <module>
    from openai.error import Timeout
ModuleNotFoundError: No module named 'openai.error'

Which I solved with pip install --upgrade litellm==1.0.0. This is a little suspicious since it is one of the only frozen dependencies... requirements.txt:

typer
langchain
yaspin
openai
tree_sitter
litellm==0.1.213
pydantic==1.10.8

So, what's up with mixing poetry and pip?