# Updating Julia, IJulia

**URL:** <https://discourse.julialang.org/t/updating-julia-ijulia/106289>\
**Category:** New to Julia\
**Created:** [November 16, 2023, 2:59am UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289 "2023-11-16T02:59:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 16, 2023, 2:59am UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/1 "2023-11-16T02:59:22Z")

</div>

I previously used an Julia 1.5 with the IJulia notebook to run an Mimi package.  
I installed the new version of Julia via julia-1.9.3-win64.exe.

The new path is C:\Users\Ken\AppData\Local\Programs\Julia-1.9.3\bin

The IJulia quick start [GitHub - JuliaLang/IJulia.jl: Julia kernel for Jupyter](https://github.com/JuliaLang/IJulia.jl#quick-start)  
says Install IJulia from the Julia REPL by pressing `]` , then enter: add IJulia.  
This gives errors;  
Updating registry at `C:\Users\Ken\.julia\registries\General`  
ERROR: GitError(Code:ENOTFOUND, Class:Config, config value ‘safe.directory’ was not found)

The IJulia page says " Alternatively, you can have IJulia create and manage its own Python/Jupyter installation. To do this, type the following in Julia, at the `julia>` prompt:  
using IJulia  
This gives errors;  
Package IJulia not found, but a package named IJulia is available from a  
registry.  
Install package?  
(@v1.9) pkg\> add IJulia  
(y/n/o) [y]:  
Updating registry at `C:\Users\Ken\.julia\registries\General`  
ERROR: GitError(Code:ENOTFOUND, Class:Config, config value ‘safe.directory’ was not found)  
Both methods give the same error.

This other IJulia page [Installation · IJulia](https://julialang.github.io/IJulia.jl/dev/manual/installation/)  
says "… If you install a new Julia binary (or do anything that _changes the location of Julia_ on your computer), you _must_ update the IJulia installation (to tell Jupyter where to find the new Julia) by running Pkg.build(“IJulia”)  
at the Julia command line.  
This gives errors;  
ERROR: UndefvarError: ‘Pkg’ not defined

The two IJulia pages give different instructions, neither apparently work.  
Please provide instructions so that I can run the IJulia and notebook.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [November 16, 2023, 6:31am UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/2 "2023-11-16T06:31:41Z")

</div>

Sorry to see you having such troubles getting going.  
I don’t think this is an error with IJulia: it seems that there is a problem with the package installation process. Can you install another unrelated package, like `DataFrames` ?

---

<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, 8:51am UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/3 "2023-11-16T08:51:41Z")

</div>

It appears that you may have a git configuration issue related to the following security issue.

> **[Git security vulnerability announced](https://github.blog/2022-04-12-git-security-vulnerability-announced/)**
>
> Upgrade your local installation of Git, especially if you are using Git for Windows, or you use Git on a multi-user machine.

I suggest the following action. Rename the folder “C:\Users\Ken.julia\registries” to “C:\Users\Ken.julia\registries\_old”. Then retry adding IJulia.

The last error that you reported can be fixed by doing `using Pkg` before running `Pkg.add("IJulia")`

The following Julia REPL command sequence might help address the issue.

```julia-repl
julia> rpath = joinpath(DEPOT_PATH[1], "registries")

julia> mv(rpath, rpath *"_old")

julia> using Pkg

julia> pkg"registry add General"

julia> pkg"add IJulia"

```

Could you tell us about the `C:\Users\Ken\.julia`  
directory? Did you copy it from another computer or has it been there since you last tried Julia 1.5?

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 16, 2023, 9:51pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/4 "2023-11-16T21:51:39Z")

</div>

I am running Windows10.  
I changes “C:\Users\Ken.julia\registries” to “C:\Users\Ken.julia\registries\_old”.  
At the julia\> prompt I entered; rpath = joinpath(DEPOT\_PATH[1], “registries”)  
Julia returned: “C:\users\Ken.julia\registries”  
I entered; mv(rpath, rpath \*“\_old”)  
Julia returned: ERROR: ArgumentError: 'C:\users\Ken.julia\registries\_old" exists. ‘force=true’ is required to remove ‘C:\users\Ken.julia\registries\_old’ before moving.

I am not sure what that is asking me to do. What is my next step?

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 16, 2023, 9:54pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/5 "2023-11-16T21:54:44Z")

</div>

I didn’t copy `C:\Users\Ken\.julia` from another computer. The directory was installed with Julia1.5 or possibly and older Julia.

---

<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:45pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/6 "2023-11-16T22:45:10Z")

</div>

Repeat and change it to `mv(rpath, rpath *"_old2")`.

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 16, 2023, 11:01pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/7 "2023-11-16T23:01:56Z")

</div>

at the pkg\> prompt I entered; add DataFrames  
Julia returned;  
Installing known registries into `C:\Users\Ken\.julia`  
Updating registry at `C:\Users\Ken\.julia\registries\General.toml`  
Resolving package versions…  
Installed Crayons ──────────── v4.1.1  
…  
Precompiling project…  
25 dependencies successfully precompiled in 61 seconds. 5 already precompiled.  
pkg\> So it installed fine.

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 16, 2023, 11:23pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/8 "2023-11-16T23:23:49Z")

</div>

I repeated as you requested and got the same error message.  
That is, I changed C:\Users\Ken.julia\registries to C:\Users\Ken.julia\registries\_old2  
At the julia\> prompt I entered; rpath = joinpath(DEPOT\_PATH[1], “registries”)  
Julia returned: “C:\users\Ken.julia\registries”  
I entered; mv(rpath, rpath \*“\_old2”)  
Julia returned: ERROR: ArgumentError: 'C:\users\Ken.julia\registries\_old2" exists. ‘force=true’ is required to remove ‘C:\users\Ken.julia\registries\_old2’ before moving.

I didn’t see why repeating what I did before would get a successful result.

---

<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 17, 2023, 1:29am UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/9 "2023-11-17T01:29:40Z")

</div>

Well it does not matter now that you got the packages to install.

It sounds like you solved your problem.

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 17, 2023, 8:01pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/10 "2023-11-17T20:01:32Z")

</div>

I entered at the prompt;  
Julia\> import pkg  
Julia\> using IJulia  
Julia\> notebook()

The Jupyter notebook opened.  
I opened the file; Documents/MimiFUND.jl-3.13.0/examples/fund\_demo.ipynb  
The notebook shows “Kernel Error”, so from the menu I selected; Kernel\> Change kernel\> which shows Julia 1.2, 1.4, 1.5.3.  
There is no Julia 1.9.3 listed.  
How can I make the Jupter notebook to recognize Julia 1.9.3 version?

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [November 17, 2023, 8:07pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/11 "2023-11-17T20:07:44Z")

</div>

Please use triple backticks before and after the code, so that your posts become more readable 😉

I think that rebuilding `IJulia` should help, that step always reinstalls the kernel configuration. Try the following:

```julia
julia> import Pkg

julia> Pkg.build("IJulia")

```

after that, reload the Jupyter notebook web GUI and you should see the Julia kernel.

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 17, 2023, 9:41pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/12 "2023-11-17T21:41:31Z")

</div>

I don’t know what triple backticks are. What key strokes? I can use the quotes is this window’s menu. I used the command;

> julia\> Pkg.build(“IJulia”)

That worked. Thanks.

Question: When I enter;

> Julia\> notebook()

Julia gives many lines of info with a flashing cursor on the last line, and the notebook opens in a brower. I hoped that clicking on “Logout” at the top to the notebook would cause the Julia window to display the Julia prompt but it doesn’t.  
How do I return to a Julia prompt without closing the Julia window and restarting Julia?

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [November 17, 2023, 9:55pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/13 "2023-11-17T21:55:26Z")

</div>

> [@KGregory](#):
>
> I can use the quotes is this window’s menu.

You are almost there, just one button to the right (looks like `</>`), it will insert two lines with triple backticks.

> [@KGregory](#):
>
> I hoped that clicking on “Logout” at the top to the notebook would cause the Julia window to display the Julia prompt but it doesn’t.  
> How do I return to a Julia prompt without closing the Julia window and restarting Julia?

Even if you close the browser, the notebook’s kernel will still run. This can be quite handy if you don’t want to accidentally lose the session when closing the window. If you want your Julia prompt back, you can hit `CTRL+C`. It might be that this keyboard combination will not work on Windows, I have no idea. In UNIX-like systems `CTRL+C` sends a keyboard-interrupt signal. On windows it’s the “copy to clipboard” command 😉 but it depends on what kind of terminal/powershell you use (I have no experience running this stuff on Windows). Maybe try `SHIFT+CTRL+C` if `CTRL+C` has no effect…

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 17, 2023, 11:56pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/14 "2023-11-17T23:56:20Z")

</div>

In Julia, I entered commands;

> Pkg\> add Mimi  
> Pkg\> add MimiFUND  
> Julia\> using Mimi  
> Julia\> using MimiFUND  
> Julia\> m = MimiFUND.get\_model()  
> Julia\> run(m)  
> Julia\> m[:socioecomonic, :income]

Then Julia produces an array of income values.  
However, in the Jupyter notebook, I run the first cell;

`using Mimi`

notebook gives

> ArgumentError: Package Mimi [e4e893b0-ee5e-52ea-8111-44b3bdec128c] is required but does not seem to be installed:
> 
> - Run `Pkg.instantiate()` to install all recorded dependencies.

so I ran in the next cell;

`Pkg.instantiate()`  
which give the error;  
`UndefVarError: `Pkg` not defined`

So Mimi and MImiFUND work is Julia, but not in the notebook.  
What am I doing wrong?

---

<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 18, 2023, 1:08am UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/15 "2023-11-18T01:08:39Z")

</div>

In the Jupyter notebook, run

```julia
using Pkg
Pkg.status()

```

Then report the output to us.

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 18, 2023, 3:00am UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/16 "2023-11-18T03:00:46Z")

</div>

That returns;

Project MimiFUND v3.13.0  
Status `C:\Users\Ken\Documents\MimiFUND.jl-3.13.0\Project.toml`  
[8bb1440f] DelimitedFiles  
[31c24e10] Distributions  
[e4e893b0] Mimi  
[2913bbd2] StatsBase  
[ade2ca70] Dates  
[9a3f8284] Random

---

<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 18, 2023, 4:30am UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/17 "2023-11-18T04:30:08Z")

</div>

Run thr following in the notebook.

```julia
using Pkg
Pkg.instantiate()

```

---

<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 18, 2023, 5:12am UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/18 "2023-11-18T05:12:10Z")

</div>

Also, why does it look like you just hit the download button on Github rather than following the instructiosn here:

> **[GitHub - fund-model/MimiFUND.jl: FUND - Climate Framework for Uncertainty,...](https://github.com/fund-model/MimiFUND.jl#getting-started)**
>
> FUND - Climate Framework for Uncertainty, Negotiation and Distribution - GitHub - fund-model/MimiFUND.jl: FUND - Climate Framework for Uncertainty, Negotiation and Distribution

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 18, 2023, 5:33pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/19 "2023-11-18T17:33:53Z")

</div>

OK, this worked. MimiFUND now runs fine in the notebook.  
Note that I was just following the instruction. The notebook error only says to Run `Pkg.instantiate()`. It doesn’t say to run `using Pkg` before that. This error message should be fixed.

Thanks for your help

Now I want to understand where my updating Julia, IJulia, Mimi and MimiFUND went wrong. I’ll reply to your next message soon.

---

<div class="post-metadata">

**Author:** ![KGregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kgregory/32/203950_2.png) [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Post date:** [November 18, 2023, 5:45pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289/20 "2023-11-18T17:45:33Z")

</div>

I started by going to [GitHub - fund-model/MimiFUND.jl: FUND - Climate Framework for Uncertainty, Negotiation and Distribution](https://github.com/fund-model/MimiFUND.jl)  
where it said;

> You need to install [Julia 1.6.0](https://julialang.org) or newer to run this model. You can download Julia from [Download Julia](http://julialang.org/downloads/).

So I chose Windows 64-bit installer and downloaded julia-1.9.3-win64.exe

I double-clicked that file and istalled it. I uninstall my previous two versions of Julia.  
Are you implying that this action was incorrect?

[Next page](https://discourse.julialang.org/t/updating-julia-ijulia/106289.md?page=2)
