aider icon indicating copy to clipboard operation
aider copied to clipboard

Uncaught ImportError in utils.py line 9

Open DivineAlways opened this issue 1 year ago • 2 comments

Aider version: 0.70.0 Python version: 3.12.2 Platform: Linux-6.8.0-51-generic-x86_64-with-glibc2.39 Python implementation: CPython Virtual environment: No OS: Linux 6.8.0-51-generic (64bit) Git version: git version 2.43.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 1007, in main
    coder.run()
  File "base_coder.py", line 806, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 853, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1235, in send_message
    litellm_ex = LiteLLMExceptions()
                 ^^^^^^^^^^^^^^^^^^^
  File "exceptions.py", line 55, in __init__
    self._load()
  File "exceptions.py", line 58, in _load
    import litellm
  File "__init__.py", line 9, in <module>
    from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler
  File "http_handler.py", line 10, in <module>
    from litellm.caching import InMemoryCache
  File "__init__.py", line 1, in <module>
    from .caching import Cache, LiteLLMCacheType
  File "caching.py", line 40, in <module>
    from litellm.types.utils import all_litellm_params
  File "utils.py", line 9, in <module>
    from openai.types.completion_usage import (
ImportError: cannot import name 'CompletionTokensDetails' from 'openai.types.completion_usage' (/home/dantee/miniconda3/lib/python3.12/site-packages/openai/types/completion_usage.py)

DivineAlways avatar Jan 06 '25 07:01 DivineAlways

can someone help

DivineAlways avatar Jan 06 '25 07:01 DivineAlways

Thanks for trying aider and filing this issue.

This looks like a duplicate of #1690. Please see the comments there for more information, and feel free to continue the discussion within that issue.

I'm going to close this issue for now. But please let me know if you think this is actually a distinct issue and I will reopen this issue.

Note: A bot script made these updates to the issue.

github-actions[bot] avatar Jan 06 '25 12:01 github-actions[bot]