2

I have Julia 1.9.2 installed (current stable release) in a portable fashion. (The .zip file julialang.org offers). It's extracted to an external flash drive (E:\Julia-1.9.2\...) due to university computer restrictions. How do I install a package within the portable Julia install? I would like to leave no trace of Julia on the host computer and keep everything within the external flash drive.

That is, instead of

julia> import Pkg; Pkg.add("Pluto")
    Updating registry at `C:\Users\...`

I would like to see

julia> import Pkg; Pkg.add("Pluto")
    Updating registry at `E:\Julia-1.9.2\...`
rigel
  • 485
  • 1
  • 6
  • 12

1 Answers1

2
  1. Set the variable

    set JULIA_DEPOT_PATH=E:\Julia-1.9.2\...
    
  2. Run Julia

  3. Version info should show something like:

    julia> versioninfo()
    Julia Version 1.9.2
    ...
    Environment:
      JULIA_DEPOT_PATH = E:\Julia-1.9.2\...
    
  4. Install packages - now they will end up at the E:\Julia-1.9.2\...

Przemyslaw Szufel
  • 40,002
  • 3
  • 32
  • 62
  • Is there a way to do this after opening Julia? I've since found the question https://stackoverflow.com/a/44918155/ and I'm not sure what caches I would need to refresh if I set `ENV["JULIA_DEPOT_PATH"] = "E:\\Julia-1.9.2\..."`. Or in that case, should I by pass the `$JULIA_DEPOT_PATH` entirely and go with `$JULIA_PKGDIR`? – rigel Aug 22 '23 at 14:32