# Running two different versions of Julia simultaneously

**URL:** https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758
**Category:** General Usage
**Created:** [September 11, 2023, 7:50pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758 "2023-09-11T19:50:49Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![cnf](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@cnf](https://discourse.julialang.org/u/cnf)
#### Post date: [September 11, 2023, 7:50pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/1 "2023-09-11T19:50:50Z")

</div>

Hi,

I am using julia1.5.2 (on a linux machine) and noticed  
that it creates a directory .julia under my home directory  
and installs downloaded packages there.

I have installed julia1.6.7 in a different directory to  
julia1.5.2

I want to use julia1.6.7 but suspect that it will install  
downloaded packages in the above-mentioned .julia  
directory thus overwriting the existing files there.

I would be grateful if you could provide some steps  
on how to direct julia1.6.7 to use a different directory  
for installing packages, for example, .julia1.6.7

Thank you.

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [September 11, 2023, 8:05pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/2 "2023-09-11T20:05:07Z")

</div>

Multiple Julia versions are designed to be able to cooperate in the same depot (`.julia`) but if you absolutely don’t want them to, you can set the environment variable `JULIA_DEPOT_PATH` to point elsewhere.

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [September 11, 2023, 8:07pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/3 "2023-09-11T20:07:04Z")

</div>

They will both write into `.julia` but they will write into separate parts. For example, I have

```julia
ls ~/.julia/environments/
v1.10/ v1.11/ v1.6/ v1.7/ v1.8/ v1.9/

```

Also, any specific reason you’re still using 1.5.2? That’s a pretty out of date version (so is 1.6.7, but that is an LTS which makes it a little more understandable).

---

<div class="post-metadata">

### Author: ![cnf](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@cnf](https://discourse.julialang.org/u/cnf)
#### Post date: [September 11, 2023, 8:21pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/4 "2023-09-11T20:21:37Z")

</div>

As you suggest, I can set the environment variable JULIA\_DEPOT\_PATH to the directory /home/…/.julia1.6.7

But then, how will I direct julia1.5.2 to use .julia and julia1.6.7 to use .julia1.6.7?

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [September 11, 2023, 8:21pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/5 "2023-09-11T20:21:47Z")

</div>

No problem at all to install any number of Julia versions in parallel. I have a run\_julia script per project, and use  
´´´  
jill switch 1.9  
julia --project  
´´´  
or whatever version is needed for the current project to activate the correct julia version. You can achieve the same result with juliaup, just the command is different.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [September 11, 2023, 8:22pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/6 "2023-09-11T20:22:57Z")

</div>

No need for changing JULIA\_DEPOT\_PATH… Don’t do it.

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [September 11, 2023, 8:26pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/7 "2023-09-11T20:26:29Z")

</div>

> [@cnf](#):
>
> But then, how will I direct julia1.5.2 to use .julia and julia1.6.7 to use .julia1.6.7?

There are many ways to arrange that but for example you can create a shell alias something like

```julia
alias julia1.6.7='JULIA_DEPOT_PATH=/home/.../.julia1.6.7 /path/to/julia1.6.7'

```

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [September 11, 2023, 8:35pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/8 "2023-09-11T20:35:03Z")

</div>

> [@ufechner7](#):
>
> No need for changing JULIA\_DEPOT\_PATH… Don’t do it.

There are valid reasons to use separate depots although I suspect that it’s overly conservative in this case. I use two depots myself to handle two completely separate environments with different private registries and different package servers.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [September 11, 2023, 8:43pm UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/9 "2023-09-11T20:43:10Z")

</div>

> [@GunnarFarneback](#):
>
> I use two depots myself to handle two completely separate environments with different private registries and different package servers.

Well, this are valid reasons to use different depot paths, but if you just need different Julia versions per project there is no reason to use them.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [September 12, 2023, 8:39am UTC](https://discourse.julialang.org/t/running-two-different-versions-of-julia-simultaneously/103758/10 "2023-09-12T08:39:47Z")

</div>

Honestly think twice before doing this - messing with the load path is more of an advanced use case. Fwiw I’ve been using Julia since 0.3 and have every version from 0.6 to 1.10beta2 installed on my current machine, all with a single `.julia` directory and without any load path shenanigans.
