# The setting of environment variables

**URL:** <https://community.wandb.ai/t/the-setting-of-environment-variables/5067>\
**Category:** W&B Help\
**Tags:** wandb\
**Created:** [September 14, 2023, 9:23am UTC](https://community.wandb.ai/t/the-setting-of-environment-variables/5067 "2023-09-14T09:23:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![matrixmax](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@matrixmax](https://community.wandb.ai/u/matrixmax)\
**Post date:** [September 14, 2023, 9:23am UTC](https://community.wandb.ai/t/the-setting-of-environment-variables/5067/1 "2023-09-14T09:23:13Z")

</div>

The first time I used wandb login from the command line, I encountered the error PermissionError: [Errno 13] Permission denied: ‘/tmp/.config/wandb/’.  
However, I have checked that the permissions on the /tmp folder are: “rwxrwxrwt”, and I can also create new files in /tmp. I hope i can get the answer about the permission of the tmp file.

Later, using the developer guide, I temporarily solved this problem by using os.environ[“WANDB\_CONFIG\_DIR”] = op.join (OS.getcwd (),“tmp”)  
in my py file.

However, I didn’t want to add such a paragraph to my script every time, so I tried adding environment variables to the.bashrc file. However, when I source.bashrc, “WANDB\_DIR: command not found” is displayed. I am also looking forward to your answer on how to correctly set environment variables

---

<div class="post-metadata">

**Author:** ![nathank](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@nathank](https://community.wandb.ai/u/nathank)\
**Post date:** [September 18, 2023, 8:19pm UTC](https://community.wandb.ai/t/the-setting-of-environment-variables/5067/2 "2023-09-18T20:19:14Z")

</div>

Hi @matrixmax, is `tmp/` the root directory on this machine? That config file should normally end up in `~/.config/wandb/settings` unless this path is unwritable. It may be worth figuring out why wandb doesn’t have access to write to `~/`

Also, could you let me know how you were attempting to set this in your bashrc?

---

<div class="post-metadata">

**Author:** ![matrixmax](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@matrixmax](https://community.wandb.ai/u/matrixmax)\
**Post date:** [September 19, 2023, 2:08am UTC](https://community.wandb.ai/t/the-setting-of-environment-variables/5067/3 "2023-09-19T02:08:51Z")

</div>

Thank you very much for your reply, the “tmp” directory I mentioned is the root directory of the system, namely: the “/tmp” folder.  
Do you mean that I should check the permissions for the “~/.config/” folder? Okay, I’ll go back and try  
The Settings in.bashrc are shown in the following figure. The directory used was the tmp folder I created in my own home directory.  
 ![Snipaste_2023-09-19_10-04-25](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/2X/e/e4348ca8a2724171174be6606b1185a17f918dfe.png)

---

<div class="post-metadata">

**Author:** ![raphael-sanandres](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@raphael-sanandres](https://community.wandb.ai/u/raphael-sanandres)\
**Post date:** [September 26, 2023, 11:56pm UTC](https://community.wandb.ai/t/the-setting-of-environment-variables/5067/4 "2023-09-26T23:56:28Z")

</div>

Hello! It looks like Python doesn’t have permissions to write to the `.config/wandb file` and you probably need to use `chmod` to update the permissions. Have you checked the permissions for the “~/.config/” folder and were you able to fix this issue after changing the permissions?

---

<div class="post-metadata">

**Author:** ![matrixmax](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@matrixmax](https://community.wandb.ai/u/matrixmax)\
**Post date:** [September 27, 2023, 3:09am UTC](https://community.wandb.ai/t/the-setting-of-environment-variables/5067/5 "2023-09-27T03:09:29Z")

</div>

Thank you very much for your reply! I have checked that the permissions for the “~/.config/” directory are:

`drwxrwxr-x 10 wxl wxl 10 Sep 19 10:03 .config/`

, and the permissions of the “/tmp” directory are:

`drwxrwxrwt 3970 root root 159744 Sep 27 11:06 tmp/`

But that still doesn’t solve the problem

---

<div class="post-metadata">

**Author:** ![raphael-sanandres](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@raphael-sanandres](https://community.wandb.ai/u/raphael-sanandres)\
**Post date:** [September 29, 2023, 7:50pm UTC](https://community.wandb.ai/t/the-setting-of-environment-variables/5067/6 "2023-09-29T19:50:13Z")

</div>

Could you try to make a new environment or try a separate environment to try this in? We do not have any known permissions issues on our end and all the signs seem to point to this being an environment-based permission issue. Hopefully this can be solved with a different environment since it purely looks like your current environment is having issues.

---

<div class="post-metadata">

**Author:** ![raphael-sanandres](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@raphael-sanandres](https://community.wandb.ai/u/raphael-sanandres)\
**Post date:** [October 3, 2023, 10:04pm UTC](https://community.wandb.ai/t/the-setting-of-environment-variables/5067/7 "2023-10-03T22:04:38Z")

</div>

Hi xingliang, 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:** [November 28, 2023, 7:50pm UTC](https://community.wandb.ai/t/the-setting-of-environment-variables/5067/8 "2023-11-28T19:50:36Z")

</div>

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