# Best way to Re-Install Julia on new computer?

**URL:** https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103
**Category:** New to Julia
**Tags:** installation
**Created:** [November 12, 2023, 3:29am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103 "2023-11-12T03:29:45Z")
**Posts on this page:** 13
**Page:** 2

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [November 16, 2023, 10:47pm UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/21 "2023-11-16T22:47:52Z")

</div>

You can put your old Project.toml and Manifest.toml into any folder, activate that environment/folder, then instantiate it. It’s possible that would just work.

The way I should usually do this is.

1. Copy Project.toml and Manifest.toml into directory “foo”
2. In Julia,

```julia
cd("foo")
using Pkg
pkg"activate ."
pkg"instantiate"

```

---

<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: [November 17, 2023, 1:26am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/22 "2023-11-17T01:26:57Z")

</div>

> [@CosmoProf](#):
>
> I got my old Manifest.toml & Project.toml files back

Great!

My package [GitHub - ufechner7/PkgHelpers.jl: Helper functions for the Julia package manager](https://github.com/ufechner7/PkgHelpers.jl) might help here:

- copy the two files in any folder
- install julia 1.4 with juliaup: `juliaup add 1.4` and `juliup default 1.4`
- install PkgHelpers with `using Pkg; Pkg.add("PkgHelpers")`
- launch your old environment with `julia --project`
- type

```julia
using PkgHelpers,Pkg
freeze(Pkg)

```

What this command does is to add the current version numbers of all of your packages to the `[compat]` section of your `Project.toml` file .

- quit Julia and install Julia 1.5
- run it with `julia --project`
- run `using Pkg; Pkg.instantiate()` and perhaps Pkg.resolve()
- fix any errors that might pop up
- and continue that with Julia 1.6, 1.7, 1.8 and 1.9

Better do it step by step, errors are much easier to fix this way.

---

<div class="post-metadata">

### Author: ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)
#### Post date: [November 17, 2023, 3:09am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/23 "2023-11-17T03:09:58Z")

</div>

Hi, thanks for the procedure. I’m trying it out, but I am going in a circle with these errors:  
(yes, PolyFit is one of my old packages)  
(`Pkg.resolve()` did not help, gave similar errors)

`julia> using PkgHelpers`  
ERROR: ArgumentError: Package PkgHelpers not found in current path:

- Run `import Pkg; Pkg.add("PkgHelpers")` to install the PkgHelpers package.

`julia> Pkg.add("PkgHelpers")`  
Updating registry at `C:\Users\phybdb\.julia\registries\General`  
Updating git-repo `https://github.com/JuliaRegistries/General.git`  
Resolving package versions…  
ERROR: expected package `PolyFit [097a2a50]` to exist at path `C:\Users\phybdb.julia\packages\PolyFit\zPgON````

`julia> using PkgHelpers`  
ERROR: ArgumentError: Package PkgHelpers not found in current path:

- Run `import Pkg; Pkg.add("PkgHelpers")` to install the PkgHelpers package.

Stacktrace:  
[1] require(::Module, ::Symbol) at .\loading.jl:892```

---

<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: [November 17, 2023, 7:16am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/24 "2023-11-17T07:16:56Z")

</div>

Are you still on Julia 1.4 ?

If yes, can you instantiate your project?

```julia
cd myproject
julia --project
using Pkg; Pkg.instantiate()

```

Try to install PkgHelpers in the global environment, and put your Project.toml and Manifest.toml in a folder of your choice, called project environment.

To install a package in the global environment run Julia without the parameter --project.

---

<div class="post-metadata">

### Author: ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)
#### Post date: [November 17, 2023, 7:43pm UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/25 "2023-11-17T19:43:51Z")

</div>

Hi, tried running Julia 1.4.2 in the global environment, got the error message:

````julia

julia> Pkg.add("PkgHelpers")
   Updating registry at `C:\Users\phybdb\.julia\registries\General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Pkg [44cfe95a]:
 Pkg [44cfe95a] log:
 ├─possible versions are: 1.4.0 or uninstalled
 └─found to have no compatible versions left with PkgHelpers [a562b63c]
   └─PkgHelpers [a562b63c] log:
     ├─possible versions are: [0.1.0, 0.2.0] or uninstalled
     └─restricted to versions * by an explicit requirement, leaving only versions [0.1.0, 0.2.0]```
````

---

<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: [November 17, 2023, 8:37pm UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/26 "2023-11-17T20:37:27Z")

</div>

Can you try:

```julia
Pkg.add(PackageSpec(url="https://github.com/ufechner7/PkgHelpers.jl", rev="main"))

```

I just relaxed the requirement from Julia 1.6 to 1.4 as minimum.

EDIT: Tried to fix the issues with Julia 1.4. Please, give it another try!

---

<div class="post-metadata">

### Author: ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)
#### Post date: [January 21, 2024, 6:35am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/27 "2024-01-21T06:35:41Z")

</div>

Hi again, I’ve struggled some more with my old code in the new Julia, so I want to get the simplest instructions possible to do the following…

Globally, my new version is Julia 1.10.0. My old code ran perfectly well under Julia 1.4.2. My old computer (with that old Julia) is dead and gone, but I have copies of its last working versions of `Manifest.toml` and `Project.toml`. Currently, JuliaPro is gone, so I am now running Julia with Visual Studio Code. I have installed the new Julia with Juliaup, and I have already run the command: `juliaup add 1.4.2`, and it says: ` `1.4.2` is already installed`. So far, so good.

I created a directory called `C:\MyResearchPlace\OldPrograms`. In that directory, I placed the key old files: `Manifest.toml`, `Project.toml`, and `LovelyOldProgram.jl`. I will edit that program and place lots of modified versions of it in that same directory.

What I want, is that every time I click on a julia program (`.jl`) file located inside THAT PARTICULAR DIRECTORY, it opens up in Visual Studio Code, and when I select-all and execute the code, for it to automatically run under Julia 1.4.2, using the packages defined by the `Manifest.toml` and `Project.toml` files located in `C:\MyResearchPlace\OldPrograms`. (Simply placing those files in that directory and clicking on the julia file doesn’t seem to do the trick.)

When I open a julia program in ANY OTHER DIRECTORY, it might as well run under the global Julia 1.10.0 environment, but I don’t care as much.

I’ve seen instructions that relate to starting up Julia with line commands, but that’s not how I do it; I just click on a `.jl` file, for it to open up in Visual Studio Code, I use `Ctrl-a` to select all of the code, and then `Shift-Enter` to execute it all. There’s nowhere to type any line commands.

Thanks again for any information.

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [January 21, 2024, 8:58am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/28 "2024-01-21T08:58:40Z")

</div>

In Vscode, hit Ctrl-Shift-P.

Then select “Julia: Start REPL”

---

<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: [January 21, 2024, 9:08am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/29 "2024-01-21T09:08:20Z")

</div>

I just use the menu command “Terminal-New Terminal” in vscode and then type

```julia
julia --project

```

to get a REPL that uses the Project.toml of the current folder.  
To execute a script I use the command `include("myscript.jl")` in the REPL.

And for switching the Julia version I use:

```julia
juliup default 1.10

```

Installing a new version with `juliup add` is not sufficient, you also need to activate it.

Finally I dont’t start vscode with a double click on a Julia file. Instead, I launch it using the start menu of Windows or Linux and open a project with the vscode menu entry `File-> Open Folder...`.  
And there is the VSCode plugin “Project Manager” that allows you to switch between projects more easily.

---

<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: [January 21, 2024, 9:33am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/30 "2024-01-21T09:33:01Z")

</div>

> [@ufechner7](#):
>
> `juliup activate 1.10`

I think you mean `juliaup default 1.10`.

---

<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: [January 21, 2024, 9:48am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/31 "2024-01-21T09:48:38Z")

</div>

Fixed.

---

<div class="post-metadata">

### Author: ![CosmoProf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmoprof/32/15516_2.png) [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)
#### Post date: [January 22, 2024, 4:21am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/32 "2024-01-22T04:21:19Z")

</div>

Should it not be `juliaup default 1.4.2`, in a REPL started in the VSCode file from the directory where I’m running the old Julia?

---

<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: [January 22, 2024, 7:29am UTC](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103/33 "2024-01-22T07:29:07Z")

</div>

Yes, if you want to use Julia 1.4.2 it should be `juliaup default 1.4.2` …

[Previous page](https://discourse.julialang.org/t/best-way-to-re-install-julia-on-new-computer/106103.md?page=1)
