# Getting error while performing wandb.init()

**URL:** <https://community.wandb.ai/t/getting-error-while-performing-wandb-init/5495>\
**Category:** W&B Help\
**Tags:** wandb\
**Created:** [December 5, 2023, 10:24am UTC](https://community.wandb.ai/t/getting-error-while-performing-wandb-init/5495 "2023-12-05T10:24:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asmita-kadam](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@asmita-kadam](https://community.wandb.ai/u/asmita-kadam)\
**Post date:** [December 5, 2023, 10:24am UTC](https://community.wandb.ai/t/getting-error-while-performing-wandb-init/5495/1 "2023-12-05T10:24:30Z")

</div>

I am trying to initiate wandb in my python script. I have set the WANDB API key as environment variable. it logins and throws W&B API permission denied error. And on wandb.init() I am getting another error. I am pasting both of them below.

````auto
import wandb
import os

os.environ["WANDB_API_KEY"] = config['WANDB_API_KEY']

wandb.init()

wandb: Currently logged in as: asmita-kadam1 (tmna-trial-enterprise). Use `wandb login --relogin` to force relogin
wandb: ERROR Error while calling W&B API: permission denied (<Response [403]>)

wandb: ERROR It appears that you do not have permission to access the requested resource. Please reach out to the project owner to grant you access. If you have the correct permissions, verify that there are no issues with your networking setup.(Error 403: Forbidden)```

Do you know what might be issue .. all the things are correct as per my understanding
````

---

<div class="post-metadata">

**Author:** ![joana-marie](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@joana-marie](https://community.wandb.ai/u/joana-marie)\
**Post date:** [December 7, 2023, 10:08am UTC](https://community.wandb.ai/t/getting-error-while-performing-wandb-init/5495/2 "2023-12-07T10:08:57Z")

</div>

Hi @asmita-kadam ,

Thank you for writing in. The error seems like you are not directly initializing to the said entity, could you please try to specify it in your `wandb.init()`? like this:  
`wandb.init(entity="asmita-kadam1")`

Then in your terminal, please refresh your login to make sure that your API is tied in to the correct instance by doing this command:

- `rm ~/.netrc #deleting the netrc file` [hit enter then login as follow:]
- ` wandb login --relogin --cloud`

Let us know if that helps. Thanks~

---

<div class="post-metadata">

**Author:** ![joana-marie](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@joana-marie](https://community.wandb.ai/u/joana-marie)\
**Post date:** [December 12, 2023, 4:08am UTC](https://community.wandb.ai/t/getting-error-while-performing-wandb-init/5495/3 "2023-12-12T04:08:18Z")

</div>

Hi @asmita-kadam , since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [February 10, 2024, 4:08am UTC](https://community.wandb.ai/t/getting-error-while-performing-wandb-init/5495/4 "2024-02-10T04:08:44Z")

</div>

Closed on February 10, 2024, 4:08am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
