# How to make artifact use relative path to the project root?

**URL:** <https://community.wandb.ai/t/how-to-make-artifact-use-relative-path-to-the-project-root/5105>\
**Category:** W&B Help\
**Created:** [September 20, 2023, 2:22pm UTC](https://community.wandb.ai/t/how-to-make-artifact-use-relative-path-to-the-project-root/5105 "2023-09-20T14:22:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerluo](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@rogerluo](https://community.wandb.ai/u/rogerluo)\
**Post date:** [September 20, 2023, 2:22pm UTC](https://community.wandb.ai/t/how-to-make-artifact-use-relative-path-to-the-project-root/5105/1 "2023-09-20T14:22:02Z")

</div>

I’m using wandb on a cluster that does not have external internet, so I have to do a `rsync` after all the results are collected in offline mode, but then I realize the artifact is using absolute path, so as a result after `rsync` the absolute path is changed and I got the following errors

```auto
Syncing: https://wandb.ai/rogerluo/duck-rg/runs/2x4xugws ... wandb: ERROR Error uploading "/home/rogerluo/.local/share/wandb/artifacts/staging/tmp3j_0ic4j": FileNotFoundError, [Errno 2] No such file or directory: '/home/rogerluo/.local/share/wandb/artifacts/staging/tmp3j_0ic4j'

```

I’m wondering if there is a way to store the artifacts in the local directory with a path that relative to the project root?

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [September 25, 2023, 5:51pm UTC](https://community.wandb.ai/t/how-to-make-artifact-use-relative-path-to-the-project-root/5105/2 "2023-09-25T17:51:57Z")

</div>

Hi @rogerluo Thank you for writing in!

In order to potentially solve your concern, you will need to use `WANDB_ARTIFACT_DIR` or `WANDB_DIR` [env vars](https://docs.wandb.ai/guides/track/environment-variables#optional-environment-variables) to have control over where you store artifact files.

Here are some of the important wandb artifact directories:

- the staging directory, which is `WANDB_DATA_DIR/artifacts/staging/` (defaults to `~/.local/share/wandb/artifacts/staging/` on unix). This is where copies of files that are about to be uploaded live
- the artifact directory, which is the default location that artifacts will be downloaded to; that’s set by `WANDB_ARTIFACT_DIR` and defaults to `./artifacts/`
- the cache directory, `WANDB_CACHE_DIR/artifacts` (defaults to `~/.cache/artifacts` on unix)
- there is also `WANDB_DIR` and you may set this to an absolute path to store all generated files instead of the `wandb` directory relative to your training script. _be sure this directory exists and you have permissions to write to it_

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [September 27, 2023, 7:20pm UTC](https://community.wandb.ai/t/how-to-make-artifact-use-relative-path-to-the-project-root/5105/3 "2023-09-27T19:20:43Z")

</div>

Hi there, I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved.

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [September 29, 2023, 9:39pm UTC](https://community.wandb.ai/t/how-to-make-artifact-use-relative-path-to-the-project-root/5105/4 "2023-09-29T21:39:15Z")

</div>

Hi Roger, since we have not heard back from you, we are going to close this request. If you would like to reopen the conversation, please let us know! Unfortunately, at the moment, we do not receive notifications if a thread reopens on Discourse. So, please feel free to create a new ticket regarding your concern if you’d like to continue the conversation.

---

<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, 9:40pm UTC](https://community.wandb.ai/t/how-to-make-artifact-use-relative-path-to-the-project-root/5105/5 "2023-11-28T21:40:03Z")

</div>

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