wandb.errors.CommError
wandb.errors.CommError: project not found entity error
Stack trace
wandb.errors.CommError: project not found entity error
File "/usr/local/lib/python3.9/site-packages/wandb/sdk/wandb_init.py", line 123, in _init
self._backend = backend.Backend(self._settings)
File "/usr/local/lib/python3.9/site-packages/wandb/sdk/backend/backend.py", line 45, in __init__
self._api = InternalApi(settings=settings)
File "/usr/local/lib/python3.9/site-packages/wandb/sdk/internal/internal_api.py", line 78, in __init__
self._check_project_exists()
File "/usr/local/lib/python3.9/site-packages/wandb/sdk/internal/internal_api.py", line 120, in _check_project_exists
raise CommError("project not found entity error") Why it happens
This error occurs when wandb cannot find the specified project under the given entity (user or team). It usually happens because the project name or entity is misspelled, the project does not exist, or the API key lacks permission to access the project. It can also occur if the wandb login is not properly configured or the environment variables are missing.
Detection
Check wandb initialization logs for 'project not found entity error' and verify the project and entity names match exactly what exists in your WandB account before the run starts.
Causes & fixes
Incorrect or misspelled project name in wandb.init() call
Verify and correct the 'project' parameter in wandb.init() to exactly match the project name in your WandB dashboard.
Incorrect or misspelled entity (user or team) name in wandb.init()
Set the 'entity' parameter in wandb.init() to the correct username or team name that owns the project.
WandB API key not set or lacks access permissions
Ensure your WandB API key is set in the environment variable WANDB_API_KEY and has permission to access the specified project and entity.
Not logged in to WandB or using an outdated login session
Run 'wandb login' in your terminal or set WANDB_API_KEY environment variable before running your script.
Code: broken vs fixed
import wandb
wandb.init(project="myproject", entity="myteam") # triggers 'project not found entity error' if names are wrong import os
import wandb
os.environ["WANDB_API_KEY"] = os.getenv("WANDB_API_KEY") # Ensure API key is set
wandb.init(project="correct_project_name", entity="correct_entity_name") # fixed project and entity names Workaround
Wrap wandb.init() in try/except to catch CommError, then log the error and fallback to local logging or disable wandb logging temporarily.
Prevention
Always verify project and entity names against your WandB dashboard and set WANDB_API_KEY environment variable before running scripts to avoid authentication and configuration errors.