# Can the location of the .julia directory be changed (on windows)?

**URL:** <https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354>\
**Category:** General Usage\
**Created:** [January 28, 2024, 6:35am UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354 "2024-01-28T06:35:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [January 28, 2024, 6:35am UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/1 "2024-01-28T06:35:01Z")

</div>

I have a huge size of .julia directory (~10G) at the default location (C:\Users\xxx) but my space on C: is tight, so can I move the .julia directory to D:? Thanks.

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [January 28, 2024, 6:36am UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/2 "2024-01-28T06:36:19Z")

</div>

Set rhe environment variable `JULIA_DEPOT_PATH`.

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [January 28, 2024, 8:25am UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/3 "2024-01-28T08:25:13Z")

</div>

Just partially succeeded. After changing the environment variable and moving the .julia dir to the new location, I can use “st” in the package interface to see all the packages I previously installed, but whenever I want to use any of them, they are required to be precompiled and the latter fails. Any ideas?

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [January 28, 2024, 11:02am UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/4 "2024-01-28T11:02:05Z")

</div>

Does the error persist if you temporarily rename or move the folder containing the compiled files?

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [January 28, 2024, 12:51pm UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/5 "2024-01-28T12:51:12Z")

</div>

Do you mean the .julia/compiled folder? I renamed the folder, but the error persists:

```julia
julia> using BenchmarkTools
[Info: Precompiling BenchmarkTools [6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf]

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x204a75b -- fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2360
in expression starting at D:\photo\.julia\packages\SnoopPrecompile\1XXT1\src\SnoopPrecompile.jl:5
fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2360
uv__fs_work at /workspace/srcdir/libuv\src/win\fs.c:3206
uv_fs_chmod at /workspace/srcdir/libuv\src/win\fs.c:3758
jl_fs_chmod at /cygdrive/c/buildbot/worker/package_win64/build/src\jl_uv.c:382
#chmod#31 at .\file.jl:1089
chmod at .\file.jl:1089 [inlined]
compilecache at .\loading.jl:1358
unknown function (ip: 0000000034486fb5)
compilecache at .\loading.jl:1329
_require at .\loading.jl:1043
require at .\loading.jl:936
require at .\loading.jl:923
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
call_require at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:421 [inlined]
eval_import_path at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:458
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:684
eval_body at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:529
jl_interpret_toplevel_thunk at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:670
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:877
jl_eval_module_expr at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:195 [inlined]
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:668
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:825
jl_toplevel_eval at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:886 [inlined]
jl_toplevel_eval_in at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:929
eval at .\boot.jl:360 [inlined]
include_string at .\loading.jl:1116
_include at .\loading.jl:1170
include at .\Base.jl:384 [inlined]
include_package_for_output at .\loading.jl:1235
jfptr_include_package_for_output_21872.clone_1 at D:\photo\AppData\Local\Programs\Julia-1.6.7\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
do_call at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:115
eval_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:204
eval_stmt_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:155 [inlined]
eval_body at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:576
jl_interpret_toplevel_thunk at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:670
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:877
jl_toplevel_eval at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:886 [inlined]
jl_toplevel_eval_in at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:929
eval at .\boot.jl:360 [inlined]
eval at .\client.jl:446
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
do_call at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:115
eval_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:204
eval_stmt_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:155 [inlined]
eval_body at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:576
jl_interpret_toplevel_thunk at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:670
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:877
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:825
jl_toplevel_eval at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:886 [inlined]
jl_toplevel_eval_in at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:929
eval at .\boot.jl:360 [inlined]
exec_options at .\client.jl:261
_start at .\client.jl:485
jfptr__start_28700.clone_1 at D:\photo\AppData\Local\Programs\Julia-1.6.7\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
true_main at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:560
repl_entrypoint at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:702
mainCRTStartup at /cygdrive/c/buildbot/worker/package_win64/build/cli\loader_exe.c:51
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 2648 (Pool: 2638; Big: 10); GC: 0
ERROR: LoadError: LoadError: Failed to precompile SnoopPrecompile [66db9d55-30c0-4569-8b51-7e840670fc0c] to D:\photo\.julia\compiled\v1.6\SnoopPrecompile\jl_5A05.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
  [7] include(mod::Module, _path::String)
    @ Base .\Base.jl:384
  [8] include(x::String)
    @ Parsers D:\photo\.julia\packages\Parsers\9bboQ\src\Parsers.jl:1
  [9] top-level scope
    @ D:\photo\.julia\packages\Parsers\9bboQ\src\Parsers.jl:427
 [10] include
    @ .\Base.jl:384 [inlined]
 [11] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base .\loading.jl:1235
 [12] top-level scope
    @ none:1
 [13] eval
    @ .\boot.jl:360 [inlined]
 [14] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [15] top-level scope
    @ none:1
in expression starting at D:\photo\.julia\packages\Parsers\9bboQ\src\precompile.jl:1
in expression starting at D:\photo\.julia\packages\Parsers\9bboQ\src\Parsers.jl:1
ERROR: LoadError: LoadError: Failed to precompile Parsers [69de0a69-1ddd-5017-9359-2bf0b02dc9f0] to D:\photo\.julia\compiled\v1.6\Parsers\jl_5254.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
  [7] include(mod::Module, _path::String)
    @ Base .\Base.jl:384
  [8] include(x::String)
    @ JSON D:\photo\.julia\packages\JSON\NeJ9k\src\JSON.jl:3
  [9] top-level scope
    @ D:\photo\.julia\packages\JSON\NeJ9k\src\JSON.jl:11
 [10] include
    @ .\Base.jl:384 [inlined]
 [11] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base .\loading.jl:1235
 [12] top-level scope
    @ none:1
 [13] eval
    @ .\boot.jl:360 [inlined]
 [14] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [15] top-level scope
    @ none:1
in expression starting at D:\photo\.julia\packages\JSON\NeJ9k\src\Parser.jl:1
in expression starting at D:\photo\.julia\packages\JSON\NeJ9k\src\JSON.jl:3
ERROR: LoadError: Failed to precompile JSON [682c06a0-de6a-54ab-a142-c8b1cf79cde6] to D:\photo\.julia\compiled\v1.6\JSON\jl_4E0E.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
  [7] include
    @ .\Base.jl:384 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base .\loading.jl:1235
  [9] top-level scope
    @ none:1
 [10] eval
    @ .\boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at D:\photo\.julia\packages\BenchmarkTools\0owsb\src\BenchmarkTools.jl:1
ERROR: Failed to precompile BenchmarkTools [6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf] to D:\photo\.julia\compiled\v1.6\BenchmarkTools\jl_4BCC.tmp.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
   @ Base .\loading.jl:1385
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base .\loading.jl:1329
 [4] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1043
 [5] require(uuidkey::Base.PkgId)
   @ Base .\loading.jl:936
 [6] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:923

```

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [January 28, 2024, 12:52pm UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/6 "2024-01-28T12:52:33Z")

</div>

The file system on my D: drive is exFAT, would that be the problem?

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [January 28, 2024, 1:26pm UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/7 "2024-01-28T13:26:49Z")

</div>

What if you run with `julia --pkgimages=no`?

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [January 28, 2024, 1:28pm UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/8 "2024-01-28T13:28:18Z")

</div>

> [@photor](#):
>
> ```julia
> Exception: EXCEPTION_ACCESS_VIOLATION at 0x204a75b -- fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2360
> in expression s
> 
> ```

Looks like Julia does not have writing permissions to the new directory.  
You could try to change the permissions (I think by right-clicking on .julia and then selecting settings or properties or something like that)

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [January 28, 2024, 1:29pm UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/9 "2024-01-28T13:29:26Z")

</div>

> [@Salmon](#):
>
> You could try to change the permissions (I think by right-clicking on .julia and then selecting settings or properties or something like that)

It’s exFAT. There are no permissions.

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [January 28, 2024, 1:29pm UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/10 "2024-01-28T13:29:54Z")

</div>

Oops I missed that

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [January 28, 2024, 1:53pm UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/11 "2024-01-28T13:53:18Z")

</div>

I use Julia 1.7.3, no such an option:

```julia
PS C:\Users\photo> D:\photo\AppData\Local\Programs\Julia-1.7.3\bin\julia.exe --pkgimages=no
ERROR: unknown option `--pkgimages=no`
PS C:\Users\photo>

```

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [January 28, 2024, 2:49pm UTC](https://discourse.julialang.org/t/can-the-location-of-the-julia-directory-be-changed-on-windows/109354/12 "2024-01-28T14:49:40Z")

</div>

It seems that the problem is indeed my exFAT file system. I made a new NTFS partition and moved the .julia folder onto it, and then the packages precompiled.
