paul-gauthier / aider

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

VERTEX AI Claude stopped working #1856

Open lincolnaleixo opened 1 day ago

lincolnaleixo commented 1 day ago

Issue

It was working perfectly just two days ago, and I haven't made any changes to the configuration on my end. Now, I'm encountering this:

litellm.APIConnectionError: No module named 'anthropic'
Traceback (most recent call last):
  File "/Users/robot/.local/share/virtualenvs/notion-tGL3aRXJ/lib/python3.12/site-packages/litellm/main.py", line 2123, in 
completion
    model_response = vertex_ai_anthropic.completion(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/robot/.local/share/virtualenvs/notion-tGL3aRXJ/lib/python3.12/site-packages/litellm/llms/vertex_ai_and_google_ai_studio
/vertex_ai_anthropic.py", line 277, in completion
    from anthropic import AnthropicVertex
ModuleNotFoundError: No module named 'anthropic'

Retrying in 0.2 seconds...
litellm.APIConnectionError: No module named 'anthropic'
Traceback (most recent call last):
  File "/Users/robot/.local/share/virtualenvs/notion-tGL3aRXJ/lib/python3.12/site-packages/litellm/main.py", line 2123, in 
completion
    model_response = vertex_ai_anthropic.completion(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/robot/.local/share/virtualenvs/notion-tGL3aRXJ/lib/python3.12/site-packages/litellm/llms/vertex_ai_and_google_ai_studio
/vertex_ai_anthropic.py", line 277, in completion
    from anthropic import AnthropicVertex
ModuleNotFoundError: No module named 'anthropic'

Retrying in 0.5 seconds...
litellm.APIConnectionError: No module named 'anthropic'
Traceback (most recent call last):
  File "/Users/robot/.local/share/virtualenvs/notion-tGL3aRXJ/lib/python3.12/site-packages/litellm/main.py", line 2123, in 
completion
    model_response = vertex_ai_anthropic.completion(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/Users/robot/.local/share/virtualenvs/notion-tGL3aRXJ/lib/python3.12/site-packages/litellm/llms/vertex_ai_and_google_ai_studio
/vertex_ai_anthropic.py", line 277, in completion
    from anthropic import AnthropicVertex
ModuleNotFoundError: No module named 'anthropic'

Version and model info

Aider v0.58.1 Main model: vertex_ai/claude-3-5-sonnet@20240620 with architect edit format, infinite output Editor model: vertex_ai/claude-3-5-sonnet@20240620 with diff edit format Weak model: vertex_ai/claude-3-haiku@20240307 Git repo: .git with 12 files Repo-map: using 1024 tokens, files refresh VSCode terminal detected, pretty output has been disabled. Use /help for help, run "aider --help" to see cmd line args

fry69 commented 1 day ago

Thank you for filing this issue.

Can you please try to install or reinstall aider in a separate Python environment? Either with venv or pipx?

Please remove the existing environment/aider installation first, e.g. with pipx:

$ pipx uninstall aider-chat
uninstalled aider-chat! ✨ 🌟 ✨
$ pipx install aider-chat
  installed package aider-chat 0.58.1, installed using Python 3.12.6
  These apps are now globally available
    - aider
done! ✨ 🌟 ✨

This document may be helpful -> https://aider.chat/docs/troubleshooting/imports.html