How to change the artifact path temporarily?

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”))
“”"

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

export JULIA_PKG_ARTIFACTS_DIR="..."

or directly in Julia:

ENV["JULIA_PKG_ARTIFACTS_DIR"] = "..."

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

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

export JULIA_DEPOT_PATH="/home/alexis/tmp"

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

1 Like