Using Different Julia Version per Project in VSCode

Hi there,

I just installed juliaup to manage Julia versions - really great tool!

I have a bunch of older projects running on Julia 1.7/8/9, and I can switch the default Julia version in the command line before I run the script.

However, I was wondering if I could just directly set the Julia version within VSCode based on the Manifest.toml that has been used (ideally on a Windows OS)? I have read a thread on discourse where it did not seem to be possible at that time, but I was wondering if this has changed since then.

Moved to tooling/vscode

I would like to second this ! My usage is that several projects uses several different version sof julia, and I would love to be able (maybe via a .juliaup file ?) to pin the julia version (or juliaup chanel) that vscode uses on each projects. Is that possible ?

The julia.executablePath setting is currently machine-overridable, which means you can set it in .vscode/settings.json.
There’s currently no way to use Julia version information from inside the Manifest.toml or its file name (IIRC the Manifest-{MAJOR}.{MINOR}.toml proposal got merged).

2 Likes

I have the current juliaup status:

lrnv@laptop ~ $ juliaup status
 Default  Channel  Version                   Update
----------------------------------------------------
          1.9.3    1.9.3+0.x64.w64.mingw32
       *  release  1.10.0+0.x64.w64.mingw32
lrnv@laptop ~ $

and then I setted a .vscode/settings.json as :

{
    "julia.executablePath": "julia +1.9.3"
}

but it did not succeed with the error “The terminal process failed to launch: A native exception occurred during launch (File not found: ).”

I guess I did somehting wrong… The issue is that I am on a windows machine, but I need colaborators on others OSs to be able to use the repo and have automatically the same julia version launched.

The classic way to handle this on Linux based HPC systems is to use the Modules environment.
I idly wonder if Juliaup can cooperate with Modules.

And yes, I am being of no help to Windows users.

Did anyone ever get a solution on this? I am having the same problem. I cant get vsc to recognize the settings I specify using JuliaUp. VSC is just bringing up the latest version of Julia regardelss.

i can specify the julia version i want in vsc by manually entering in the file path for the julia executable path parameter in my json settings, but this defeats the purpose of using juliaup. i would like juliaup to manage this for me and i can just point vsc to what i have already configured in juliaup as it relates to what override settings i have assigned for particular project envts

I was able to figure this out for a windows machine.

If you are using Juliaup to manage different versions of Julia on your machine and want to have specific versions of Julia open up for a given project envt below is the process.

For each project envt where you dont want the default (i.e. release) version of julia to load, you need to specify which version you want to use. you can do this in 1 of 2 ways:

  1. create a .julia-version file and put it in the same folder as your julia project directory
  2. in cmd or PS, navigate to project directory and execute a juliaup override command (e.g., juliaup override set 1.10.4).

set your executable path for julia in vsc:

  1. open up your json settings (ctrl+shift+p); open user settings (JSON)
  2. “julia.executablePath”: …\AppData\Local\Microsoft\WindowsApps\julia.exe"

Note that the version that shows up in paranthesis may still show the latest (i.e. release) version, but if you type in julia> VERSION julia will return the actual version that is active in the REPL, which should match the version you are expecting to see.

image

1 Like