Can't find project using the python API

Hello,

I have a problem where wandb doesn’t seem to find my project or any of my runs when using Python.
This is the code I am trying to run:

import wandb
api = wandb.Api()

run = api.run("<entity>/<project>/<run_id>")
run.config["key"] = updated_value
run.update()

It returns this message:

wandb.errors.CommError: Could not find run <Run <entity>/<project>/<run_id> (not found)>

I also tried to run this code:

runs = wandb.Api().runs("<entity>/<project>", filters={<one of my filter values>}) 
print(f"matching runs: {len(runs)}")

But again this returns the error:

ValueError: Could not find project <project>

I use version 0.15.11 of wandb and version 3.6.13 of Python, but I have also tried newer Python versions with wandb 0.15.12.

The strange thing is that I have code like this that ran perfectly before. I have made no changes and all of a sudden it stops finding my project, breaking all of my existing code. I’ve tried different ways to login, to access the project, and tried different computers but nothing works. Can you help with this?

Hello @sholk ,happy to help and apologies for running into this. To further assist could I ask for the following:

  1. Link to the run where you are trying to query via api
  2. Could you update to latest version of wandb pip install -U wandb
  3. Try refreshing login: from command line: rm ~/.netrc followed by wandb login --relogin --cloud

Thanks~!

1 Like

Thank you for the help!

Step 3 was the key. Have tried re-login before, but I think removing the ~/.netrc file was what made the difference.

1 Like

Hello @sholk Thank you for the confirmation, we’ll mark this as resolved, and feel free to write for any other concern if ever.