Having installed several versions of Julia on machine. How to open a specific version of julia from PowerShell?

I have two versions of Julia installed on my machine 1.6.3 and 1.8.0-beta 1. When I write julia in the PowerShell, it opens 1.6.3, how can I select the demanded version? I tried something like below, but it didn’t work

C:\> julia-1.8.0-beta1

You can call the binary for the different installations by using the full path.
julia alone opens the binary that is available using the PATH environment variable.

I usually setup a custom shell in the new windows terminal to start a specific version.

2 Likes

Thank you very much.

Another issue, I have many packages installed in 1.6.3 how can I made them installed also in 1.8.0-beta 1, such coping some files…

I usually place a Project.toml or even manifest file in my project directories.

To generate them just activate the project directory in the package mode and then add the required packages. I think julia can then also use already installed packed without reinstalling.

In case you already have a Project.toml you can call instantiate in the pkg mode of the REPL to force an installation.

I usually only have very few packages installed in the default environment.

If you don’t want to use Project files you can also activate named environments by using pkg> activate @myname. I don’t know if they are available between version though.

3 Likes

The packages for the default environment are also stored in a Project.toml file.
You can find it by calling status

(@v1.7) pkg> st
      Status `~/.julia/environments/v1.7/Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.1
  [c3e4b0f8] Pluto v0.18.1
  [b8865327] UnicodePlots v2.9.0

2 Likes

Thank you very much.

1 Like

You can also use juliaup for this scenario, see Julia in the Windows Store | David Anthoff | JuliaCon2021 - YouTube. Just make sure you uninstall your other Julia versions before you switch over to using juliaup.

3 Likes

I am not sure if it is possible, but can the Windows store version also ship with custom profiles for the Windows terminal? :smiley:

It does :slight_smile:

2 Likes

I’m also new to Julia, but here is what I do and I think they’re working well (I’m using MacOS):

Download and installing two versions of Julia, let’s say 1.6.7 and 1.9.3. Then add Julia to PATH by running:

sudo mkdir -p /usr/local/bin
sudo rm -f /usr/local/bin/julia1.6
sudo ln -s /Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia1.6
sudo rm -f /usr/local/bin/julia1.9
sudo ln -s /Applications/Julia-1.9.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia1.9

And then I can launch different Julia by running julia1.6 or julia1.9 from terminal.

I think things will be similar in Windows or Linux. Hope it helps.

I would say this is not the preferred solution. Having juliaup installed makes managing versions very easy.

Add new channels (Julia versions) with juliaup add 1.6.3 say and run with julia +1.6.3.
(The 1.6.3 is just an example, you can do it with lts, release, beta or specific julia versions)

You can then alias in your command line for the specific versions.

2 Likes

Thanks, I will have a try!

Would you mind pointing me to the documentation for the +<version> option? I couldn’t find it on the CLI page.

This option is specific to Juliaup