How to use multiple versions of Julia on Windows

Viewed 397

I have installed both Julia 1.5.2 as well as Julia 1.6.1

But my default Julia version is still 1.5.2 on command prompt. How can I change it or use both version on command prompt?

Thanks

3 Answers

The command prompt reads from your PATH variables, which you can edit in the relevant settings. On Windows 10, if you just search for PATH you should be offered these options:

enter image description here

From there, click "Environment Variables", then select "Path" in the next window and press "Edit". You should see a list of your current environment variables which includes Julia 1.5.2 and 1.6.1 installation paths. You can now remove Julia 1.5.2 (or move 1.6.1 above 1.5.2 in the list) to make 1.6.1 the default version that gets started when you type julia at the prompt.

Note that you'll have to restart your terminal (or maybe even your system) for the change to take effect.

It should be quite easy.

First of all, you have to find the folders in which both version are installed. By default that would be C:/Users/username/AppData/Local/Programs/Julia-1.X.X. In your case there should be Julia-1.5.2 and Julia-1.6.1.

When you located them, you should check what your Path variable is. I can't tell for sure, but I suspect that your Path is pointing to both 1.5.2 and 1.6.1 versions, and because the executable files have the same name it just takes the first one. If it isn't, add a new value.

Now you can rename one of your executables. For example, rename file Julia-1.5.2/bin/julia.exe to julia-5.exe.

Edit:

The simplest solution is now to install Julia through the Microsoft Store, this installs the Julia version manager juliaup

updating and switch julia versions is so much easier with this:

set the default version:

juliaup default 1.5.3

add a specific version:

juliaup add 1.5.1
juliaup add beta

launch a specific version (must be added before)

julia +1.5
julia +beta

Old answer:

I use Powershell, here is what I do,

you can define aliases in $profile:

New-Alias julia1.6.1 C:\\Users\\user\\AppData\\Local\\Programs\\Julia-1.6.1\\bin\\julia.exe
New-Alias julia1.5.3 C:\\Users\\user\\AppData\\Local\\Programs\\Julia-1.5.3\\bin\\julia.exe
New-Alias julia julia1.6.1

to see where it is and edit it:

echo $profile
notepad $profile

then, you can call julia, julia1.5.3 etc...

Related