# How to set the environment variable WANDB\_IGNORE\_GLOBS correctly?

**URL:** <https://community.wandb.ai/t/how-to-set-the-environment-variable-wandb-ignore-globs-correctly/3423>\
**Category:** W&B Help\
**Tags:** wandb\
**Created:** [November 16, 2022, 7:04am UTC](https://community.wandb.ai/t/how-to-set-the-environment-variable-wandb-ignore-globs-correctly/3423 "2022-11-16T07:04:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![geyao](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@geyao](https://community.wandb.ai/u/geyao)\
**Post date:** [November 16, 2022, 7:04am UTC](https://community.wandb.ai/t/how-to-set-the-environment-variable-wandb-ignore-globs-correctly/3423/1 "2022-11-16T07:04:43Z")

</div>

The usage in the [Docs](https://docs.wandb.ai/guides/track/advanced/environment-variables#optional-environment-variables) is:

> Set this to a comma separated list of file globs to ignore. These files will not be synced to the cloud

So, is the below code correct?

```python
os.environ['WANDB_IGNORE_GLOBS'] = '[*.pth, *.npy]'

```

---

<div class="post-metadata">

**Author:** ![geyao](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@geyao](https://community.wandb.ai/u/geyao)\
**Post date:** [November 17, 2022, 1:08pm UTC](https://community.wandb.ai/t/how-to-set-the-environment-variable-wandb-ignore-globs-correctly/3423/2 "2022-11-17T13:08:01Z")

</div>

The code seems to be incorrect because the \*.npy files still be uploaded (the \*.pth files are ignored successfully).

---

<div class="post-metadata">

**Author:** ![thanos-wandb](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@thanos-wandb](https://community.wandb.ai/u/thanos-wandb)\
**Post date:** [November 17, 2022, 3:17pm UTC](https://community.wandb.ai/t/how-to-set-the-environment-variable-wandb-ignore-globs-correctly/3423/3 "2022-11-17T15:17:40Z")

</div>

Hi @geyao thank you for writing in! Could you please check if the following would work for you?

```auto
os.environ['WANDB_IGNORE_GLOBS'] = '*.pth,*.npy'

```

---

<div class="post-metadata">

**Author:** ![geyao](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@geyao](https://community.wandb.ai/u/geyao)\
**Post date:** [November 18, 2022, 3:13am UTC](https://community.wandb.ai/t/how-to-set-the-environment-variable-wandb-ignore-globs-correctly/3423/4 "2022-11-18T03:13:06Z")

</div>

Thanks for your reply, it works! I also find that it fails if there are spaces after the comma separator.

---

<div class="post-metadata">

**Author:** ![thanos-wandb](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@thanos-wandb](https://community.wandb.ai/u/thanos-wandb)\
**Post date:** [November 18, 2022, 3:51pm UTC](https://community.wandb.ai/t/how-to-set-the-environment-variable-wandb-ignore-globs-correctly/3423/5 "2022-11-18T15:51:35Z")

</div>

Great to hear @geyao this now works - and thanks for adding the additional information, indeed I confirmed it won’t work with spaces in between. Have a great weekend!

---

<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:** [January 17, 2023, 3:51pm UTC](https://community.wandb.ai/t/how-to-set-the-environment-variable-wandb-ignore-globs-correctly/3423/6 "2023-01-17T15:51:37Z")

</div>

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