Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aider didn't see my env file in pipx version on macOS #2362

Open
rodion-m opened this issue Nov 13, 2024 · 8 comments
Open

Aider didn't see my env file in pipx version on macOS #2362

rodion-m opened this issue Nov 13, 2024 · 8 comments
Labels
question Further information is requested

Comments

@rodion-m
Copy link

Issue

Starting from some version of aider it stopped to see my .env that is located in the aider install directory.

Now the .env file is located in %user%/.local/pipx/venvs/aider-chat.

Version and model info

Aider: 0.62.1 installed via pipx
OS: macOS

@paul-gauthier
Copy link
Collaborator

Thanks for trying aider and filing this issue.

When reporting problems, it is very helpful if you can provide:

  • Aider version
  • LLM model you are using
  • Any stack traces or error messages
  • A description of what you were doing when the error happened.

Including the “announcement” lines that aider prints at startup is an easy way to share some of this helpful info.

Aider v0.37.1-dev
Models: gpt-4o with diff edit format, weak model gpt-3.5-turbo
Git repo: .git with 243 files
Repo-map: using 1024 tokens

@rodion-m
Copy link
Author

Warning: claude-3-5-sonnet-20241022 expects these environment variables
- ANTHROPIC_API_KEY: Not set
If you just set these environment variables using `setx` you may need to restart your terminal or command prompt for the changes to take effect.
You can skip this check with --no-show-model-warnings

that's all.

@lib-rxi
Copy link

lib-rxi commented Nov 13, 2024

Adding to the above issue , I found the same error . It looks like it did not picked up the .env file.
Tried on vertexai - claude model . -"vertex_ai/claude-3-5-sonnet-v2@20241022"

then reverted back to aider-chat 42.0 and it worked. Not sure when exactly the problem started.
The issue I had was that aider was using a default location "us-central1" in gcp eventhough we setup the right region in the .env file.

I'm running aider from python , but couldn't figure out how to specify the .env file

@paul-gauthier
Copy link
Collaborator

If you run with --verbose aider will tell you which env file it loads.

@lib-rxi
Copy link

lib-rxi commented Nov 13, 2024

Sorry , Its working on CLI , its throwing error only when called via python for me.

@paul-gauthier
Copy link
Collaborator

Ah. It would be very hard for me to help debug your python scripting of aider.

@lib-rxi
Copy link

lib-rxi commented Nov 13, 2024

How can use debug on python , is that flag passed to Model?

fnames=["README.md"]
model = Model("vertex_ai/claude-3-5-sonnet-v2@20241022")
# Create a coder object
coder = Coder.create(main_model=model, fnames=fnames)

coder.run ("what does this repo do?")

its a simple prompt to check if it works , and threw error on 62.0 but works on 42.0.

@lib-rxi
Copy link

lib-rxi commented Nov 13, 2024

*update: I was able to fix it for my use-case with a workaround.
we just have to load the env manually in our client script before calling aider.

from dotenv import load_dotenv
# Load the .env file
load_dotenv()

@paul-gauthier paul-gauthier added the question Further information is requested label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants