Aider-AI / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
20.6k stars 1.9k forks source link

Uncaught ModuleNotFoundError in caching.py line 22 #1459

Closed rdmayo21 closed 4 weeks ago

rdmayo21 commented 1 month ago

Aider version: 0.55.0 Python version: 3.12.1 Platform: Linux-6.5.0-1025-azure-x86_64-with-glibc2.31 Python implementation: CPython Virtual environment: No OS: Linux 6.5.0-1025-azure (64bit) Git version: git version 2.46.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "base_coder.py", line 1105, in send_message
    yield from self.send(messages, functions=self.functions)
  File "base_coder.py", line 1377, in send
    hash_object, completion = send_completion(
                              ^^^^^^^^^^^^^^^^
  File "sendchat.py", line 86, in send_completion
    res = litellm.completion(**kwargs)
          ^^^^^^^^^^^^^^^^^^
  File "llm.py", line 23, in __getattr__
    self._load_litellm()
  File "llm.py", line 30, in _load_litellm
    self._lazy_module = importlib.import_module("litellm")
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "__init__.py", line 9, in <module>
    from litellm.caching import Cache
  File "caching.py", line 22, in <module>
    from openai._models import BaseModel as OpenAIObject
ModuleNotFoundError: No module named 'openai._models'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 694, in main
    coder.run()
  File "base_coder.py", line 730, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 773, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1107, in send_message
    except retry_exceptions() as err:
           ^^^^^^^^^^^^^^^^^^
  File "sendchat.py", line 24, in retry_exceptions
    litellm.exceptions.APIConnectionError,
    ^^^^^^^^^^^^^^^^^^
  File "llm.py", line 23, in __getattr__
    self._load_litellm()
  File "llm.py", line 30, in _load_litellm
    self._lazy_module = importlib.import_module("litellm")
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "__init__.py", line 9, in <module>
    from litellm.caching import Cache
  File "caching.py", line 22, in <module>
    from openai._models import BaseModel as OpenAIObject
ModuleNotFoundError: No module named 'openai._models'
paul-gauthier commented 1 month ago

Thanks for trying aider and filing this issue.

How did you install aider? What environment are you using?

It looks like you don't have the correct set of dependencies installed.

This doc may be helpful:

https://aider.chat/docs/troubleshooting/imports.html

I'm going to close this issue for now, but feel free to add a comment here and I will re-open. Or feel free to file a new issue any time.

rdmayo21 commented 1 month ago

I'm using github codespaces.

paul-gauthier commented 1 month ago

How did you install aider there?

rdmayo21 commented 1 month ago

Codespace fires up an instance of vscode and I just did the following in the terminal:

pip install aider-chat Collecting aider-chat Downloading aider_chat-0.56.0-py3-none-any.whl.metadata (19 kB) Collecting aiohappyeyeballs==2.4.0 (from aider-chat) Downloading aiohappyeyeballs-2.4.0-py3-none-any.whl.metadata (5.9 kB) Collecting aiohttp==3.10.5 (from aider-chat) Downloading aiohttp-3.10.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.5 kB) Collecting aiosignal==1.3.1 (from aider-chat) Downloading aiosignal-1.3.1-py3-none-any.whl.metadata (4.0 kB) Collecting annotated-types==0.7.0 (from aider-chat) Downloading annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB) Requirement already satisfied: anyio==4.4.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (4.4.0) Requirement already satisfied: attrs==24.2.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (24.2.0) Collecting backoff==2.2.1 (from aider-chat) Downloading backoff-2.2.1-py3-none-any.whl.metadata (14 kB) Requirement already satisfied: beautifulsoup4==4.12.3 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (4.12.3) Requirement already satisfied: certifi==2024.7.4 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (2024.7.4) Requirement already satisfied: cffi==1.17.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (1.17.0) Requirement already satisfied: charset-normalizer==3.3.2 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (3.3.2) Collecting click==8.1.7 (from aider-chat) Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB) Collecting configargparse==1.7 (from aider-chat) Downloading ConfigArgParse-1.7-py3-none-any.whl.metadata (23 kB) Collecting diff-match-patch==20230430 (from aider-chat) Downloading diff_match_patch-20230430-py3-none-any.whl.metadata (5.2 kB) Collecting diskcache==5.6.3 (from aider-chat) Downloading diskcache-5.6.3-py3-none-any.whl.metadata (20 kB) Collecting distro==1.9.0 (from aider-chat) Downloading distro-1.9.0-py3-none-any.whl.metadata (6.8 kB) Collecting filelock==3.15.4 (from aider-chat) Downloading filelock-3.15.4-py3-none-any.whl.metadata (2.9 kB) Collecting flake8==7.1.1 (from aider-chat) Downloading flake8-7.1.1-py2.py3-none-any.whl.metadata (3.8 kB) Collecting frozenlist==1.4.1 (from aider-chat) Downloading frozenlist-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB) Collecting fsspec==2024.6.1 (from aider-chat) Downloading fsspec-2024.6.1-py3-none-any.whl.metadata (11 kB) Requirement already satisfied: gitdb==4.0.11 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (4.0.11) Requirement already satisfied: gitpython==3.1.43 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (3.1.43) Collecting grep-ast==0.3.3 (from aider-chat) Downloading grep_ast-0.3.3-py3-none-any.whl.metadata (2.6 kB) Requirement already satisfied: h11==0.14.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (0.14.0) Requirement already satisfied: httpcore==1.0.5 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (1.0.5) Collecting httpx==0.27.2 (from aider-chat) Downloading httpx-0.27.2-py3-none-any.whl.metadata (7.1 kB) Collecting huggingface-hub==0.24.6 (from aider-chat) Downloading huggingface_hub-0.24.6-py3-none-any.whl.metadata (13 kB) Collecting idna==3.8 (from aider-chat) Downloading idna-3.8-py3-none-any.whl.metadata (9.9 kB) Collecting importlib-metadata==7.2.1 (from aider-chat) Downloading importlib_metadata-7.2.1-py3-none-any.whl.metadata (4.6 kB) Collecting importlib-resources==6.4.4 (from aider-chat) Downloading importlib_resources-6.4.4-py3-none-any.whl.metadata (4.0 kB) Requirement already satisfied: jinja2==3.1.4 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (3.1.4) Collecting jiter==0.5.0 (from aider-chat) Downloading jiter-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.6 kB) Requirement already satisfied: json5==0.9.25 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (0.9.25) Requirement already satisfied: jsonschema==4.23.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (4.23.0) Requirement already satisfied: jsonschema-specifications==2023.12.1 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (2023.12.1) Collecting litellm==1.44.7 (from aider-chat) Downloading litellm-1.44.7-py3-none-any.whl.metadata (32 kB) Collecting markdown-it-py==3.0.0 (from aider-chat) Downloading markdown_it_py-3.0.0-py3-none-any.whl.metadata (6.9 kB) Requirement already satisfied: markupsafe==2.1.5 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (2.1.5) Collecting mccabe==0.7.0 (from aider-chat) Downloading mccabe-0.7.0-py2.py3-none-any.whl.metadata (5.0 kB) Collecting mdurl==0.1.2 (from aider-chat) Downloading mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB) Collecting multidict==6.0.5 (from aider-chat) Downloading multidict-6.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.2 kB) Requirement already satisfied: networkx==3.2.1 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (3.2.1) Collecting numpy==1.26.4 (from aider-chat) Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB) Collecting openai==1.42.0 (from aider-chat) Downloading openai-1.42.0-py3-none-any.whl.metadata (22 kB) Requirement already satisfied: packaging==24.1 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (24.1) Collecting pathspec==0.12.1 (from aider-chat) Downloading pathspec-0.12.1-py3-none-any.whl.metadata (21 kB) Requirement already satisfied: pexpect==4.9.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (4.9.0) Requirement already satisfied: pillow==10.4.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (10.4.0) Requirement already satisfied: prompt-toolkit==3.0.47 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (3.0.47) Requirement already satisfied: ptyprocess==0.7.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (0.7.0) Collecting pycodestyle==2.12.1 (from aider-chat) Downloading pycodestyle-2.12.1-py2.py3-none-any.whl.metadata (4.5 kB) Requirement already satisfied: pycparser==2.22 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (2.22) Collecting pydantic==2.8.2 (from aider-chat) Downloading pydantic-2.8.2-py3-none-any.whl.metadata (125 kB) Collecting pydantic-core==2.20.1 (from aider-chat) Downloading pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB) Collecting pyflakes==3.2.0 (from aider-chat) Downloading pyflakes-3.2.0-py2.py3-none-any.whl.metadata (3.5 kB) Requirement already satisfied: pygments==2.18.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (2.18.0) Collecting pypandoc==1.13 (from aider-chat) Downloading pypandoc-1.13-py3-none-any.whl.metadata (16 kB) Collecting pyperclip==1.9.0 (from aider-chat) Downloading pyperclip-1.9.0.tar.gz (20 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting python-dotenv==1.0.1 (from aider-chat) Downloading python_dotenv-1.0.1-py3-none-any.whl.metadata (23 kB) Requirement already satisfied: pyyaml==6.0.2 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (6.0.2) Requirement already satisfied: referencing==0.35.1 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (0.35.1) Collecting regex==2024.7.24 (from aider-chat) Downloading regex-2024.7.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (40 kB) Requirement already satisfied: requests==2.32.3 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (2.32.3) Collecting rich==13.8.0 (from aider-chat) Downloading rich-13.8.0-py3-none-any.whl.metadata (18 kB) Requirement already satisfied: rpds-py==0.20.0 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (0.20.0) Collecting scipy==1.13.1 (from aider-chat) Downloading scipy-1.13.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB) Collecting setuptools-scm==8.1.0 (from aider-chat) Downloading setuptools_scm-8.1.0-py3-none-any.whl.metadata (6.6 kB) Requirement already satisfied: smmap==5.0.1 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (5.0.1) Requirement already satisfied: sniffio==1.3.1 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (1.3.1) Collecting sounddevice==0.5.0 (from aider-chat) Downloading sounddevice-0.5.0-py3-none-any.whl.metadata (1.4 kB) Collecting soundfile==0.12.1 (from aider-chat) Downloading soundfile-0.12.1-py2.py3-none-manylinux_2_31_x86_64.whl.metadata (14 kB) Requirement already satisfied: soupsieve==2.6 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (2.6) Collecting tiktoken==0.7.0 (from aider-chat) Downloading tiktoken-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB) Collecting tokenizers==0.19.1 (from aider-chat) Downloading tokenizers-0.19.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.7 kB) Collecting tqdm==4.66.5 (from aider-chat) Downloading tqdm-4.66.5-py3-none-any.whl.metadata (57 kB) Collecting tree-sitter==0.21.3 (from aider-chat) Downloading tree_sitter-0.21.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (10 kB) Collecting tree-sitter-languages==1.10.2 (from aider-chat) Downloading tree_sitter_languages-1.10.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (10 kB) Collecting typing-extensions==4.12.2 (from aider-chat) Downloading typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB) Requirement already satisfied: urllib3==2.2.2 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (2.2.2) Requirement already satisfied: wcwidth==0.2.13 in /home/codespace/.local/lib/python3.12/site-packages (from aider-chat) (0.2.13) Collecting yarl==1.9.4 (from aider-chat) Downloading yarl-1.9.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (31 kB) Collecting zipp==3.20.1 (from aider-chat) Downloading zipp-3.20.1-py3-none-any.whl.metadata (3.7 kB) Requirement already satisfied: setuptools in /home/codespace/.local/lib/python3.12/site-packages (from setuptools-scm==8.1.0->aider-chat) (73.0.1) Downloading aider_chat-0.56.0-py3-none-any.whl (37.9 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 37.9/37.9 MB 8.3 MB/s eta 0:00:00 Downloading aiohappyeyeballs-2.4.0-py3-none-any.whl (12 kB) Downloading aiohttp-3.10.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 13.6 MB/s eta 0:00:00 Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB) Downloading annotated_types-0.7.0-py3-none-any.whl (13 kB) Downloading backoff-2.2.1-py3-none-any.whl (15 kB) Downloading click-8.1.7-py3-none-any.whl (97 kB) Downloading ConfigArgParse-1.7-py3-none-any.whl (25 kB) Downloading diff_match_patch-20230430-py3-none-any.whl (42 kB) Downloading diskcache-5.6.3-py3-none-any.whl (45 kB) Downloading distro-1.9.0-py3-none-any.whl (20 kB) Downloading filelock-3.15.4-py3-none-any.whl (16 kB) Downloading flake8-7.1.1-py2.py3-none-any.whl (57 kB) Downloading frozenlist-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (281 kB) Downloading fsspec-2024.6.1-py3-none-any.whl (177 kB) Downloading grep_ast-0.3.3-py3-none-any.whl (11 kB) Downloading httpx-0.27.2-py3-none-any.whl (76 kB) Downloading huggingface_hub-0.24.6-py3-none-any.whl (417 kB) Downloading idna-3.8-py3-none-any.whl (66 kB) Downloading importlib_metadata-7.2.1-py3-none-any.whl (25 kB) Downloading importlib_resources-6.4.4-py3-none-any.whl (35 kB) Downloading jiter-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (319 kB) Downloading litellm-1.44.7-py3-none-any.whl (8.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.6/8.6 MB 37.9 MB/s eta 0:00:00 Downloading markdown_it_py-3.0.0-py3-none-any.whl (87 kB) Downloading mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB) Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB) Downloading multidict-6.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (130 kB) Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.0/18.0 MB 46.6 MB/s eta 0:00:00 Downloading openai-1.42.0-py3-none-any.whl (362 kB) Downloading pathspec-0.12.1-py3-none-any.whl (31 kB) Downloading pycodestyle-2.12.1-py2.py3-none-any.whl (31 kB) Downloading pydantic-2.8.2-py3-none-any.whl (423 kB) Downloading pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 22.5 MB/s eta 0:00:00 Downloading pyflakes-3.2.0-py2.py3-none-any.whl (62 kB) Downloading pypandoc-1.13-py3-none-any.whl (21 kB) Downloading python_dotenv-1.0.1-py3-none-any.whl (19 kB) Downloading regex-2024.7.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (790 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 790.9/790.9 kB 8.6 MB/s eta 0:00:00 Downloading rich-13.8.0-py3-none-any.whl (241 kB) Downloading scipy-1.13.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (38.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.2/38.2 MB 45.2 MB/s eta 0:00:00 Downloading setuptools_scm-8.1.0-py3-none-any.whl (43 kB) Downloading sounddevice-0.5.0-py3-none-any.whl (32 kB) Downloading soundfile-0.12.1-py2.py3-none-manylinux_2_31_x86_64.whl (1.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 15.6 MB/s eta 0:00:00 Downloading tiktoken-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 13.8 MB/s eta 0:00:00 Downloading tokenizers-0.19.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.6/3.6 MB 34.5 MB/s eta 0:00:00 Downloading tqdm-4.66.5-py3-none-any.whl (78 kB) Downloading tree_sitter-0.21.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (502 kB) Downloading tree_sitter_languages-1.10.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.4/8.4 MB 1.7 MB/s eta 0:00:00 Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB) Downloading yarl-1.9.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (322 kB) Downloading zipp-3.20.1-py3-none-any.whl (9.0 kB) Building wheels for collected packages: pyperclip Building wheel for pyperclip (pyproject.toml) ... done Created wheel for pyperclip: filename=pyperclip-1.9.0-py3-none-any.whl size=11004 sha256=6c732fb3df7ab000262382cf5a31e5af5606878095da7db8543154f4227a4cb2 Stored in directory: /home/codespace/.cache/pip/wheels/e0/e8/fc/8ab8aa326e33bc066ccd5f3ca9646eab4299881af933f94f09 Successfully built pyperclip Installing collected packages: pyperclip, zipp, typing-extensions, tree-sitter, tqdm, setuptools-scm, regex, python-dotenv, pypandoc, pyflakes, pycodestyle, pathspec, numpy, multidict, mdurl, mccabe, jiter, importlib-resources, idna, fsspec, frozenlist, filelock, distro, diskcache, diff-match-patch, configargparse, click, backoff, annotated-types, aiohappyeyeballs, yarl, tree-sitter-languages, soundfile, sounddevice, scipy, pydantic-core, markdown-it-py, importlib-metadata, flake8, aiosignal, tiktoken, rich, pydantic, huggingface-hub, httpx, grep-ast, aiohttp, tokenizers, openai, litellm, aider-chat Attempting uninstall: typing-extensions Found existing installation: typing_extensions 4.9.0 Uninstalling typing_extensions-4.9.0: Successfully uninstalled typing_extensions-4.9.0 Attempting uninstall: numpy Found existing installation: numpy 2.1.0 Uninstalling numpy-2.1.0: Successfully uninstalled numpy-2.1.0 Attempting uninstall: idna Found existing installation: idna 3.7 Uninstalling idna-3.7: Successfully uninstalled idna-3.7 Attempting uninstall: fsspec Found existing installation: fsspec 2024.2.0 Uninstalling fsspec-2024.2.0: Successfully uninstalled fsspec-2024.2.0 Attempting uninstall: filelock Found existing installation: filelock 3.13.1 Uninstalling filelock-3.13.1: Successfully uninstalled filelock-3.13.1 Attempting uninstall: scipy Found existing installation: scipy 1.14.0 Uninstalling scipy-1.14.0: Successfully uninstalled scipy-1.14.0 Attempting uninstall: httpx Found existing installation: httpx 0.27.0 Uninstalling httpx-0.27.0: Successfully uninstalled httpx-0.27.0 Successfully installed aider-chat-0.56.0 aiohappyeyeballs-2.4.0 aiohttp-3.10.5 aiosignal-1.3.1 annotated-types-0.7.0 backoff-2.2.1 click-8.1.7 configargparse-1.7 diff-match-patch-20230430 diskcache-5.6.3 distro-1.9.0 filelock-3.15.4 flake8-7.1.1 frozenlist-1.4.1 fsspec-2024.6.1 grep-ast-0.3.3 httpx-0.27.2 huggingface-hub-0.24.6 idna-3.8 importlib-metadata-7.2.1 importlib-resources-6.4.4 jiter-0.5.0 litellm-1.44.7 markdown-it-py-3.0.0 mccabe-0.7.0 mdurl-0.1.2 multidict-6.0.5 numpy-1.26.4 openai-1.42.0 pathspec-0.12.1 pycodestyle-2.12.1 pydantic-2.8.2 pydantic-core-2.20.1 pyflakes-3.2.0 pypandoc-1.13 pyperclip-1.9.0 python-dotenv-1.0.1 regex-2024.7.24 rich-13.8.0 scipy-1.13.1 setuptools-scm-8.1.0 sounddevice-0.5.0 soundfile-0.12.1 tiktoken-0.7.0 tokenizers-0.19.1 tqdm-4.66.5 tree-sitter-0.21.3 tree-sitter-languages-1.10.2 typing-extensions-4.12.2 yarl-1.9.4 zipp-3.20.1

paul-gauthier commented 1 month ago

Thanks for the detailed install logs. They show openai 1.42.0 being installed, which is the correct version. But that version appears to have the _models attribute:

$ grep openai== requirements.txt
openai==1.42.0

$ python
Python 3.12.4 (main, Jun  6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import openai
>>> openai.__version__
'1.42.0'
>>> openai._models
<module 'openai._models' from '/Users/gauthier/Projects/aider/.venv/lib/python3.12/site-packages/openai/_models.py'>

Any chance you had somehow installed a different openai version in your environment? Were you pip installing non-aider packages that might have dragged in a different version?

rdmayo21 commented 1 month ago

Yes, looking back in the aider chat history, it looks like openai 0.27.8 was added to the requirements.txt by aider.

paul-gauthier commented 4 weeks ago

This looks like a duplicate of #1283, so I'm going to close it so discussion can happen there. Please let me know if you think it's actually a distinct issue.