可以在Jupyter笔记本中运行Julia吗?

发布于 2025-01-30 11:02:26 字数 1081 浏览 2 评论 0原文

有没有人从Jupyter笔记本上运行Julia有问题?

我已经看了 and 非常建议相同的步骤:

  1. 打开终端,启动Julia和pkg.add(“ Ijulia”)

我遵循此步骤,并获得以下输出

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. 启动jupyter会话,然后选择朱莉娅内核。

我能够启动jupyter会话。但是,当我单击新的时,我所有的选项都是Python内核。我看不到任何地方可以推出朱莉娅内核。

有人遇到了类似的问题吗?

我正在运行Macos Monterey,版本12.4,Apple M1 Max Chip。

我的朱莉娅是1.7.2

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

只是一片海 2025-02-06 11:02:26

尝试其他步骤2:

julia> using IJulia

julia> notebook()

这应该在新的浏览器/选项卡窗口中打开jupyter。您在此窗口中看到朱莉娅内核吗? (在这种情况下,系统上可能只安装了不同的Jupyter版本)。

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).

倾`听者〃 2025-02-06 11:02:26

您可能正在使用jupyter笔记本,该笔记本不带有ijulia,因此,您将必须安装一个内核规范(一个JSON文件),因此> jupyter知道在哪里可以找到朱莉娅内核。

尝试以下内容:
https://julialang.github.github.github.iio/ijulia.jlia.jlia.jlia.jlia.jlia.jlia.jl /stable/Manual/installation/#

更具体地

您可以通过将Env [“ Jupyter”]设置为Jupyter程序的路径来强制使用特定的Jupyter安装,然后才能运行PKG.Build(“ Ijulia”)

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")

明媚殇 2025-02-06 11:02:26

这可能是因为您安装的Jupyter笔记本未安装Ijulia。您将必须加载ijulia才能使用Julia内核来访问Jupyter,以解决该问题。

julia> using IJulia

julia> notebook()

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()
梦行七里 2025-02-06 11:02:26

我遇到了同样的问题,这是较旧版本的jupyter的结果。我通过卸载和重新安装最新的jupyter解决了它,然后通过R Studio和朱莉娅站点添加了R和Julia内核,每个内核安装都不需要超过2分钟,并且一切正常。

祝你好运
ek

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文