# How to change the artifact path temporarily?

**URL:** <https://discourse.julialang.org/t/how-to-change-the-artifact-path-temporarily/120950>\
**Category:** General Usage\
**Created:** [October 5, 2024, 4:57am UTC](https://discourse.julialang.org/t/how-to-change-the-artifact-path-temporarily/120950 "2024-10-05T04:57:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![happyxie](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/happyxie/32/212425_2.png) [@happyxie](https://discourse.julialang.org/u/happyxie)\
**Post date:** [October 5, 2024, 4:57am UTC](https://discourse.julialang.org/t/how-to-change-the-artifact-path-temporarily/120950/1 "2024-10-05T04:57:49Z")

</div>

I am trying to download some matrices from SuiteSparseMatrixCollection and it always downloads it to C:\Users\username\.julia\artifacts . Is it possible to download it to the current project directory by temporarily changing the artifact path? I checked online and found artifact could be related but could not figure it out how.

Thanks,

“”"  
using Krylov, MatrixMarket, SuiteSparseMatrixCollection  
ssmc = ssmc\_db(verbose=false)  
matrix = ssmc\_matrices(ssmc, “HB”, “bcsstk09”)  
path = fetch\_ssmc(matrix, format=“MM”)

A = MatrixMarket.mmread(joinpath(path[1], “$(matrix.name[1]).mtx”))  
“”"

---

<div class="post-metadata">

**Author:** ![amontoison](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amontoison/32/218741_2.png) [@amontoison](https://discourse.julialang.org/u/amontoison)\
**Post date:** [October 5, 2024, 5:06am UTC](https://discourse.julialang.org/t/how-to-change-the-artifact-path-temporarily/120950/2 "2024-10-05T05:06:07Z")

</div>

I think that you can change the folder with the following environment variable:

```julia
export JULIA_PKG_ARTIFACTS_DIR="..."

```

or directly in Julia:

```julia
ENV["JULIA_PKG_ARTIFACTS_DIR"] = "..."

```

---

<div class="post-metadata">

**Author:** ![happyxie](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/happyxie/32/212425_2.png) [@happyxie](https://discourse.julialang.org/u/happyxie)\
**Post date:** [October 5, 2024, 6:12am UTC](https://discourse.julialang.org/t/how-to-change-the-artifact-path-temporarily/120950/3 "2024-10-05T06:12:13Z")

</div>

I am using vs code under windows. Seems not working. I also tried to set  
ENV[“JULIA\_DEPOT\_PATH”] = dir

---

<div class="post-metadata">

**Author:** ![amontoison](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amontoison/32/218741_2.png) [@amontoison](https://discourse.julialang.org/u/amontoison)\
**Post date:** [October 5, 2024, 7:28pm UTC](https://discourse.julialang.org/t/how-to-change-the-artifact-path-temporarily/120950/4 "2024-10-05T19:28:47Z")

</div>

I tested today and the correct solution is to set the environment variable `JULIA_DEPOT_PATH` **before** starting Julia.

```julia
export JULIA_DEPOT_PATH="/home/alexis/tmp"

```

We can’t do that directly from Julia with `ENV`.
