How to change Julia version in VSCode?

I have a newbie question regarding VSCode: versioninfo() tells me I am currently using 1.6.0. But I have 1.6.1 installed, so I’d like to use that instead. Here’s the output from versioninfo:

I tried to change this according to the instructions given here: I went into my Julia extension settings and changed the executable path to

I also went into my settings.json file and set my Julia executable path as the same thing (but with double backslashes, as the documentation says to, since I’m using Windows):

I then restarted VSCode, but it still says I’m using 1.6.0.

Also, I’m not sure if this is relevant, but I noticed that when I go to the executable file in Julia-1.6.1 folder and hover my mouse over the icon, it says “File version: 1.6.0.1”:

This seemed strange to me…However, I am using 1.6.1 when I’m working in Jupyter Notebook, and the Jupyter shortcut I created points to this same file…

So I’m pretty confused as to why I can’t get 1.6.1 in VSCode…Any ideas or suggestions for what I should try?

(I’m using v1.59.0 of VSCode, by the way.)

For me it works with the only configuration in Julia extension settings.
There is nothing in settings.json in my setting.
I have the same odd version for the Julia 1.6.1 binary, so this can be ignored, probably just a typo somewhere in the build process.

I don’t have any Julia entry in the environment PATH variable, so this may be the cause for your experience. Check if there is something in PATH : echo %PATH% I don’t know but perhaps it takes precedence over the other settings.

Another source could be: perhaps you have installed Julia 1.6.0 from the Windows store? In this case Julia is started from C:\Users\YOUR_NAME_HERE\AppData\Local\Microsoft\WindowsApps which is in the path by default, again this may take precedence.

1 Like

Thanks for your reply. Here’s what it shows when I tried echo %PATH% in the command prompt (I underlined all the paths containing Julia):

(Not sure why the paths for 1.6.0 and 1.6.1 are listed twice–I did try downloading 1.6.1 a second time to fix the problem, so maybe that’s why 1.6.1 appears twice…)

And I didn’t download Julia from the Windows store, I just went to julialang.org/downloads.

I figured it out! Here’s out I solved it (I’m using Windows 10, by the way):

  1. I went to Control Panel → View advanced system settings → Environment variables

  2. In the new window that popped up, I went to User variables, selected the one named Path and then clicked Edit.

  3. In the new window that appears, I located the path variable of my 1.6.0 installation, selected it, and then clicked Delete.

  4. I clicked OK, and then selected the environment variable named Path from the System variables, found the path for 1.6.0, and deleted that one as well.

  5. I restarted VSCode, started julia, and confirmed that 1.6.1 is now running!

3 Likes

One thing I should add, though I’m not sure if it matters:
Before deleting the 1.6.0 path variable, I went into the Julia extension settings and selected “Reset setting”, which made the box for the executable path blank. After deleting the 1.6.0 path variable, I checked the extension settings and the path variable there is still blank. And in the JSON file, the path got deleted as well: It now reads "julia.environmentPath": "". So apparently, VSCode was able to find my 1.6.1 installation automatically, without me having to explicitly specify it. I assume this is because of my Windows environment variable for the 1.6.1 path.

Very good description of the Windows way to edit the PATH variable. I will bookmark it, to refer to it for others in future.

Your issue here is the reason why I avoid completely having Julia in the PATH. During installation of the Julia it asks to put the current Julia into the PATH, there I recommend to unmark the option, so that it doesn’t happen. The main reason for me to prefer it his way is because I have typically many versions of Julia installed and than the PATH is just too cumbersome.

Than I have to configure the applications, VSCode and Windows Terminal, to find the different Julia versions I have. That’s much easier and I can’t forget, which version is found in which way.

1 Like

What I do is create a junction link called “Julia” to the installed Julia-x.x.x version, for example:

>mklink /J C:\Users\Michael\AppData\Local\Programs\Julia C:\Users\Michael\AppData\Local\Programs\Julia-1.6.0

Then I put the Julia link in the PATH environment variable, and otherwise use the Julia link for anyplace I need to specify a Julia path.

When I upgrade Julia versions, I only need to delete the link and create a new one that points to the new version.

3 Likes