本文介绍了Jupyter和Common Lisp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装( Jupyter ),我无法使其工作:当我打开一个新的lisp笔记本(或更改现有笔记本的内核) ),它在显示以下消息后崩溃:

I'm trying to install cl-jupyter (A common-lisp kernel for Jupyter), and I can't make it work: when I open a new lisp notebook (or change the kernel of an existing notebook), it crashes after displaying the following messages:

[I 18:26:50.855 NotebookApp] Kernel started: ccba815a-9065-4fad-9d95-06f6291136d2
To load "cl-jupyter":
  Load 1 ASDF system:
    cl-jupyter
; Loading "cl-jupyter"
...............

cl-jupyter: an enhanced interactive Common Lisp REPL
(Version 0.7 - Jupyter protocol v.5.0)
--> (C) 2014-2015 Frederic Peschanski (cf. LICENSE)

kernel configuration = ((hb_port . 58864) (shell_port . 37462)
                        (transport . tcp) (iopub_port . 43232)
                        (signature_scheme . hmac-sha256)     (control_port . 52184)
                        (stdin_port . 45879)
                        (key . 2ae7d65f-65f9-40d8-bfd4-21760eaec0ca)
                        (ip . 127.0.0.1))
[Hearbeat] starting...
[Heartbeat] thread started
[Heartbeat] thread started
[Kernel] Entering mainloop ...
[Shell] loop started
Argh! corrupted error depth, halting
fatal error encountered in SBCL pid 24605(tid 140737353922304):
%PRIMITIVE HALT called; the party is over.



一些细节:




  • Jupyter 可以正常使用python(2x和3x)。

  • sbcl 似乎工作正常(我刚开始使用common-lisp,所以我可能会遗漏一些东西 - 但我可以运行代码,并使用asdf和quicklisp)。

  • 我通过运行 python3 ./install-cl-jupyter.py 来安装它。

  • 我的 .sbclrc 文件现在只包含(load〜/ quicklisp / setup.lisp)

  • Some details:

    • Jupyter works fine with python (both 2x and 3x).
    • sbcl also seems to work fine (I'm just starting with common-lisp, so I might be missing something - but I can run code, and use asdf and quicklisp).
    • I installed it by running "python3 ./install-cl-jupyter.py".
    • My .sbclrc file now contains just "(load "~/quicklisp/setup.lisp")".

      • 操作系统:Linux 4.1 .13-1-MANJARO x86_64 GNU / Linux

      • Python 3.5.0

      • SBCL 1.3.0

      • Jupyter版本4.0.6

      • OS: Linux 4.1.13-1-MANJARO x86_64 GNU/Linux
      • Python 3.5.0
      • SBCL 1.3.0
      • Jupyter version 4.0.6

      文件〜/ .ipython / kernels / lisp / kernel.json 包含:

      {"argv": ["sbcl", "--non-interactive", "--load", "/home/myusername/lisp/systems/cl-jupyter/cl-jupyter.lisp", "/homemyusername/lisp/systems/cl-jupyter/src", "/home/myusername/lisp/systems/cl-jupyter", "{connection_file}"], "display_name": "SBCL Lisp", "language": "lisp"}
      

      所有路径都是正确的。当我手动运行相同的代码时:

      All the paths are correct. When I run the same code manually:

      sbcl --non-interactive --load "/home/myusername/lisp/systems/cl-jupyter/cl-jupyter.lisp" "/homemyusername/lisp/systems/cl-jupyter/src" "/home/myusername/lisp/systems/cl-jupyter" kernel-07e04903-c562-4c67-bcc1-b68f4047d8d2.json
      

      (其中kernel-07e04903-c562-4c67-bcc1-b68f4047d8d2.json是一个我保存的lisp内核的自动生成文件,它看起来不错(例如它运行,并且等待没有错误)。

      (where "kernel-07e04903-c562-4c67-bcc1-b68f4047d8d2.json" is an auto-generated file for a lisp-kernel that I saved), it "looks ok" (e.g. it runs, and waits with no errors).

      我尝试做一些快速的调试打印,我最好的猜测是它崩溃了 src / shell.lisp ,在行

      I tried to do some quick debug-printing, and my best guess is that it crashes in src/shell.lisp, in the line

       (vbinds (identities sig msg buffers)  (message-recv (shell-socket shell))
      

      但同样,我可能错了。因为它看起来有点与沟通有关,我确保zeromq更新。

      But again, I could be wrong. Since it kinda looks like it has something to do with communication, I made sure that zeromq is updated.

      除了学习更多的lisp之外,我不确定下一步是什么,然后回来正确调试代码 - 但我希望能使用Jupyter学习它:)

      I'm not sure what's next besides learning some more lisp, and then come back to properly debug the code - but I was hoping to learn it using Jupyter :)

      我很感激任何建议,
      谢谢。

      I'd appreciate any suggestions,Thanks.

      推荐答案

      此问题是由消息结构的大小更改引起的, zmq_msg_t ,在0MQ版本4.1.x中从64字节更改为版本4.0.x中大小为32字节。

      This issue is caused by a change in the size of the message structure, zmq_msg_t, in 0MQ version 4.1.x to 64 bytes from a size of 32 bytes in version 4.0.x.

      cl-jupyter 使用的0MQ接口库是 pzmq ,并声明该库支持0MQ到4.0版。在撰写本文时, pzmq 使用32字节的0MQ消息大小。如果安装了0MQ版本4.1.x,则会导致内部错误。

      The 0MQ interface library used by cl-jupyter is pzmq, and that library is stated to support 0MQ up to version 4.0. At the time of this writing, pzmq uses a 0MQ message size of 32 bytes. This leads to internal errors if 0MQ version 4.1.x is installed.

      此处有两种解决方案:


      1. 将0MQ安装降级到版本4.0.x

      2. 通过更新 pzmq 库code> msg%在 c-api.lisp 中,从32到64字节。

      1. Downgrade the 0MQ installation to version 4.0.x
      2. Fix the pzmq library by updating the definition of msg% in c-api.lisp from 32 to 64 bytes.



      更新 - 2016年5月9日

      pzmq 库已更新为支持0MQ版本4.1.x,(保留与旧版本的兼容性)。新版本的 pzmq 计划于2016年5月发布的Quicklisp版本中发布。

      The pzmq library was updated to support 0MQ version 4.1.x, (preserving compatibility with older versions). The new version of pzmq is planned for release as part of the May 2016 Quicklisp release.



      更新 - 2016年6月1日

      2016年5月的Quicklisp版本包含对 pzmq 解决此问题的库。不再需要降级0MQ或修改 pzmq 库。

      The May 2016 Quicklisp release includes updates to the pzmq library which resolve this issue. A downgrade of 0MQ or modifications to the pzmq library are no longer necessary.

      这篇关于Jupyter和Common Lisp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 15:19