I am using Juliaup to manage my Julai version. It is now using the 1.10 beta by default. However, for one application, I need to quickly run something in 1.9. I almost exclusively use VSCode.
Is there a way, when using Juliaup, to start a VSCode session using a specific Julai version? I guess I could reconfigure Juliaup to change its default, but I am also running other julia sessions, so it would be neat if there is a way to simply tell VSCode “use this version” (like I can do with e.g. a Jupyter notebook in VSCode).
Does this work for JuliaUp though? EIther case, it seems like I would have to go in, change the executive file, and then start VSCode, and then change it again?
Yeah, this would work, but feels like there might be something more convenient (just like juliaup lets you star ta Julia session without changing the default).
So, I think setting julia.executablePath to something like julia +1.9 should work.
What does not work (but really should) is that the VS Code extension picks up Juliaup directory overrides or the env var. That is a bit of a shame, and I hope to fix that sometime soon.
Yeah, that’s what I have been doing as well. However, that requires me to then reset the default for when I need to restart my other julia sessions (which I run in my standard environment). And then when I need to restart this julai session I have to run through it all as well.
It works, but it is a bit of a mess to keep track of.
What worked for me is using the shell to enter the correct version, and installing any package. This creates an environment which vscode should be able to detect once you reload.
EDIT: You also need to set the executablePath setting to explicitly point to juliaup, e.g. "julia.executablePath": "/Users/fred/.juliaup/bin/julia",
As of Dec 2024, there’s a much easier way to do this. Simply run juliaup override set 1.9 in your directory and then the julia command will use version 1.9 when run from that directory, regardless of how you start julia.
thanks for sharing this. I executed the following command in my project directory folder and get:
PS C:\Users\james\documents\sienna\fpa_sienna\nve_env> juliaup override set 1.10.4
Override set to ‘1.10.4’ for ‘\?\C:\Users\james\Documents\Sienna\FPA_Sienna\nve_env’.
however, when i call up my julia REPL in VSC via the alt + j + o cmd it still pulls up julia 1.11.2.
i have a blank entry for my julia executable file path location in vsc.
I also tried putting in a .julia-version file in the same folder location of my .toml files but thats not getting recognized by vsc either
Thanks! I tried implementing this but wasnt successful. It doesnt look like i have the same juliaup installation setup as you because i have the following files stored at C:\Users\james.julia\juliaup
I belive this is because I dont have juliaup directly on my path but is directly callable from windows powershell command due to “aliases”
I execute: (Get-Command juliaup).Source to get the location of my juliaup.exe file.
i set my julia executable path in vsc:
“julia.executablePath”: “C:\Users\james\AppData\Local\Microsoft\WindowsApps\juliaup.exe”,
however, unfortunately that still doesnt work (i.e. its calling the release version of julia instead of the older one that i want). note i confirmed that juliaup override is working properly via “juliaup override status”. the right version of julia comes up when i activate a repl outside of vsc. it’s just not working when i am trying to run code through vsc. pretty frustrating.
if anyone has an answer to this, i greatly appreciate input. but otherwise i give up and will just manually change the path whenever i work on this specific project requiring an older version of julia