seeker_after_truth
seeker_after_truth

Reputation: 497

Can't run Julia in Jupyter notebook?

Has anyone had a problem running julia from a jupyter notebook?

I have looked at how-to pages like this one and this one, which all pretty much recommend the same series of steps:

  1. Open the terminal, launch Julia, and Pkg.add("IJulia").

I follow this step and got the following output

Resolving package versions...
    Updating `~/.julia/environments/v1.7/Project.toml`
  [7073ff75] + IJulia v1.23.3
    Updating `~/.julia/environments/v1.7/Manifest.toml`
  [7073ff75] + IJulia v1.23.3
  [b85f4697] + SoftGlobalScope v1.1.0
  [c2297ded] + ZMQ v1.2.1
  [8f1865be] + ZeroMQ_jll v4.3.4+0
  [a9144af2] + libsodium_jll v1.0.20+0
  1. Launch a Jupyter session and choose a Julia kernel.

I'm able to launch a Jupyter session. However, when I click new, all my option are Python kernels. I don't see anywhere to launch a Julia kernel.

Has anyone run into a similar problem??

I am running macOS Monterey, version 12.4, Apple M1 Max Chip.

My julia is 1.7.2

Upvotes: 0

Views: 3060

Answers (4)

user6437539
user6437539

Reputation: 11

I had the same problem which was the result of having an older version of Jupyter. I solved it by uninstalling and reinstalling the latest jupyter, then added the R and Julia kernels from thw official R, through R Studio, and Julia sites respectively where each kernel installation did not take more than 2 minutes and all work well.

Good luck EK

Upvotes: 0

Ifihan
Ifihan

Reputation: 281

That's probably because the Jupyter notebook you have installed doesn't have IJulia installed. You will have to load IJulia to access Jupyter with a Julia kernel to fix that.

julia> using IJulia

julia> notebook()

Upvotes: 0

jling
jling

Reputation: 2301

you're probably using a jupyter notebook that didn't come with IJulia, thus, you will have to install a kernel spec (a JSON file) so the jupyter knows where to find Julia kernel.

Try following: https://julialang.github.io/IJulia.jl/stable/manual/installation/#Installing-IJulia

More specifically,

You can force it to use a specific jupyter installation by setting ENV["JUPYTER"] to the path of the jupyter program before running Pkg.build("IJulia")

Upvotes: 0

Nils Gudat
Nils Gudat

Reputation: 13800

Try a different step 2:

julia> using IJulia

julia> notebook()

This should open Jupyter in a new browser/tab window. Do you see the Julia kernel in this window? (In which case you might just have different Jupyter versions installed on your system).

Upvotes: 2

Related Questions