Can I create a virtual environment of julia 1.4.2 with conda and How

Viewed 247

I'm working with julia now, but some old version of code is deployed on julia 1.4.2, now I want to recheck the code but I don't want to switch between julia 1.6.3 (often used version) and 1.4.2. So I want to create a virtual env with conda, but now it seems that julia 1.4.2 is not available with conda. Any suggestions?

1 Answers

If you want to run more than one Julia version at a time you basically need to make sure that they use different location for package repositories (called depot path.

By default the folder used for depot path is ~/.julia (or %HOMEPATH%\.julia on Windows). If you start installing multiple Julia version you have a good chance to end up with a corrupted package repository.

Hence what you need is to set up the JULIA_DEPOT_PATH system variable - differently for each Julia version (see https://docs.julialang.org/en/v1/manual/environment-variables/).

For an example on my machine I have Julia 1.6.3 and Julia1.7.0rc2 and before starting either of them I run (Windows syntax this time):

set JULIA_DEPOT_PATH=c:\JuliaPkg\Julia1.6.3

or on Linux:

export JULIA_DEPOT_PATH=/home/ubuntu/Julia1.6.3/

This allows me to keep my package configurations separate.

Related