> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I handle the 'Failed to query for notebook' error?

If you encounter the error message `"Failed to query for notebook name, you can set it manually with the WANDB_NOTEBOOK_NAME environment variable,"` set the `WANDB_NOTEBOOK_NAME` environment variable using one of the following methods. Replace `[NOTEBOOK-NAME]` with the name of your notebook.

<Tabs>
  <Tab title="Notebook">
    ```python theme={null}
    %env "WANDB_NOTEBOOK_NAME" "[NOTEBOOK-NAME]"
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import os

    os.environ["WANDB_NOTEBOOK_NAME"] = "[NOTEBOOK-NAME]"
    ```
  </Tab>
</Tabs>

***

<Badge stroke shape="pill" color="orange" size="md">[Notebooks](/support/models/tags/notebooks)</Badge><Badge stroke shape="pill" color="orange" size="md">[Environment Variables](/support/models/tags/environment-variables)</Badge>
