joshpxyne / gpt-migrate

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

Openai error "ModuleNotFoundError: No module named 'openai.error'" #46

Open AbelBlossom opened 12 months ago

AbelBlossom commented 12 months ago

When running python main.py --targetlang nodejs I go this errror

Traceback (most recent call last):
  File "/Users/mac/Desktop/dev/abel/gpt-migrate/gpt_migrate/main.py", line 7, in <module>
    from ai import AI
  File "/Users/mac/Desktop/dev/abel/gpt-migrate/gpt_migrate/ai.py", line 6, in <module>
    from litellm import completion
  File "/Users/mac/Desktop/dev/abel/gpt-migrate/gpt_migrate/env/lib/python3.11/site-packages/litellm/__init__.py", line 28, in <module>
    from .timeout import timeout
  File "/Users/mac/Desktop/dev/abel/gpt-migrate/gpt_migrate/env/lib/python3.11/site-packages/litellm/timeout.py", line 11, in <module>
    from openai.error import Timeout
ModuleNotFoundError: No module named 'openai.error'
DrSharky commented 11 months ago

I also ran into this problem.

prestonator commented 11 months ago

Did you ever find a fix? @DrSharky @AbelBlossom

superkido511 commented 10 months ago

I fixed it by downgrading openai to 0.28.1. It not perfect but work so far

azad-resolver commented 6 months ago

I fixed it by downgrading openai to 0.28.1. It not perfect but work so far

Thanks, that fixed it for me!