fredokun / cl-jupyter

An enhanced interactive Shell for Common Lisp (based on the Jupyter protocol)
BSD 2-Clause "Simplified" License
199 stars 29 forks source link

Loading cl-jupyter.lisp does not work #22

Closed ZelphirKaltstahl closed 7 years ago

ZelphirKaltstahl commented 7 years ago

Just learning LISP, so I have no idea what could be wrong here:

sbcl --load cl-jupyter.lisp

This is SBCL 1.2.11-1.fc22, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
... initialization mode... please wait...
To load "cl-jupyter":
  Load 1 ASDF system:
    cl-jupyter
; Loading "cl-jupyter"
............
; file: /home/xiaolong/quicklisp/dists/quicklisp/software/cffi_0.17.1/toolchain/asdf-compat.lisp
; in: DEFUN BUNDLE-PATHNAME-TYPE
;     ((UIOP/OS:OS-UNIX-P) "o")
; 
; caught ERROR:
;   illegal function call

;     ((UIOP/OS:OS-WINDOWS-P)
;      (IF (UIOP/OS:FEATUREP '(:OR :MINGW32 :MINGW64))
;          "o"
;          "obj"))
; 
; caught ERROR:
;   illegal function call

;     ((UIOP/OS:OS-UNIX-P) "a")
; 
; caught ERROR:
;   illegal function call

;     ((UIOP/OS:OS-WINDOWS-P)
;      (IF (UIOP/OS:FEATUREP '(:OR :MINGW32 :MINGW64))
;          "a"
;          "lib"))
; 
; caught ERROR:
;   illegal function call

;     ((UIOP/OS:OS-MACOSX-P) "dylib")
; 
; caught ERROR:
;   illegal function call

;     ((UIOP/OS:OS-UNIX-P) "so")
; 
; caught ERROR:
;   illegal function call

;     ((UIOP/OS:OS-WINDOWS-P) "dll")
; 
; caught ERROR:
;   illegal function call

;     ((UIOP/OS:OS-UNIX-P) NIL)
; 
; caught ERROR:
;   illegal function call

;     ((UIOP/OS:OS-WINDOWS-P) "exe")
; 
; caught ERROR:
;   illegal function call
.
debugger invoked on a LOAD-SYSTEM-DEFINITION-ERROR in thread #<THREAD "main thread" RUNNING {1002D5E9C3}>: Error while trying to load definition for system pzmq from pathname /home/xiaolong/quicklisp/dists/quicklisp/software/pzmq-20160531-git/pzmq.asd: COMPILE-FILE-ERROR while compiling #<CL-SOURCE-FILE "cffi-toolchain" "toolchain" "asdf-compat">

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY                        ] Retry compiling #<CL-SOURCE-FILE "cffi-toolchain" "toolchain" "asdf-compat">.
  1: [ACCEPT                       ] Continue, treating compiling #<CL-SOURCE-FILE "cffi-toolchain" "toolchain" "asdf-compat"> as having been successful.
  2: [RETRY                        ] Retry EVAL of current toplevel form.
  3: [CONTINUE                     ] Ignore error and continue loading file "/home/xiaolong/quicklisp/dists/quicklisp/software/pzmq-20160531-git/pzmq.asd".
  4: [ABORT                        ] Abort loading file "/home/xiaolong/quicklisp/dists/quicklisp/software/pzmq-20160531-git/pzmq.asd".
  5:                                 Retry ASDF operation.
  6: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
  7:                                 Give up on "cl-jupyter"
  8:                                 Retry EVAL of current toplevel form.
  9:                                 Ignore error and continue loading file "/home/xiaolong/development/anaconda3/envs/lisp-notebook/cl-jupyter/cl-jupyter.lisp".
 10:                                 Abort loading file "/home/xiaolong/development/anaconda3/envs/lisp-notebook/cl-jupyter/cl-jupyter.lisp".
 11:                                 Ignore runtime option --load "cl-jupyter.lisp".
 12:                                 Skip rest of --eval and --load options.
 13:                                 Skip to toplevel READ/EVAL/PRINT loop.
 14: [EXIT                         ] Exit SBCL (calling #'EXIT, killing the process).

((FLET #:HANDLER1452 :IN ASDF/FIND-SYSTEM:LOAD-ASD) #<COMPILE-FILE-ERROR {10046BE7F3}>)
0] 
fredokun commented 7 years ago

Hi,

I think you have a too old version of SBCL ... I am using 1.3.7 and 1.3.8. is already available. Please tell me if it then works...

ZelphirKaltstahl commented 7 years ago

Instructions here on Github say:

either SBCL 1.2.x or above (with native threads enabled)

I have:

This is SBCL 1.2.11-1.fc22, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

Either there is a bug or the instructions are not correct ; ) I'll check if I can get a newer version running. I'd really like to have the Jupyter kernel so that I can use the useful interface, instead of that annoying SBCL, where I cannot even press arrow keys to navigate through previously entered lines : /

fredokun commented 7 years ago

Yes you're right sorry... Looking at sbcl output, it seems that libzmq is not installed. The quicklisp package pzmq requires it, I should probably explain this in the readme... BTW you can use rlwrap sbcl to have a nicer repl...

ZelphirKaltstahl commented 7 years ago

@fredokun I tried compiling a newer version of SBCL, but was unable to, because the instructions for compilation are not correct on their page and it seems files and folders needed for compilation are missing from the source code or at least that's what it is telling me when I run the sh install.sh. Then I looked up alternative REPLs for Common Lisp. CCL had the same annoying behavior as SBCL. I found CLISP in the repositories of my Fedora 22, so I installed that one and tried it. Seems to work better than the other two and offers me functionality of the arrow keys like in a Python REPL. Also it is free software as well.

I am willing to give SBCL another chance and to try and install needed dependencies for your Jupyter kernel to work.

You're saying I need to find libzmq in the repos and install it in my system? (I seem to remember that this is also needed for compiling Python, but I could be wrong.)

I've also tried rlwrap sbcl, inside the SBCL REPL as well as simply in a terminal, but neither works. I guess I don't have rlwrap?

mmaul commented 7 years ago

You should be able get a pre-compiled binary for SBCL from http://sbcl.org/platform-table.html . That should sort out that issue.

For libzmq all you need to do is install your Linux distribution's development package for zmq. So for Ubuntu for instance apt-get install libzmq-dev.

Regarding rlwrap, you don't run that from inside the REPL you run the REPL inside rlwrap. You do have to have it installed, just type rlwrap at the shell and you will find out if you do. So from the shell run rlwrap sbcl

On Thu, Aug 11, 2016 at 9:13 PM, Zelphir Kaltstahl <notifications@github.com

wrote:

@fredokun https://github.com/fredokun I tried compiling a newer version of SBCL, but was unable to, because the instructions for compilation are not correct on their page and it seems files and folders needed for compilation are missing from the source code or at least that's what it is telling me when I run the sh install.sh. Then I looked up alternative REPLs for Common Lisp. CCL had the same annoying behavior as SBCL. I found CLISP in the repositories of my Fedora 22, so I installed that one and tried it. Seems to work better than the other two and offers me functionality of the arrow keys like in a Python REPL.

I am willing to give SBCL another chance and to try and install needed dependencies for your Jupyter kernel to work.

You're saying I need to find libzmq in the repos and install it in my system? (I seem to remember that this is also needed for compiling Python, but I could be wrong.)

I've also tried rlwrap sbcl, inside the SBCL REPL as well as simply in a terminal, but neither works. I guess I don't have rlwrap?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fredokun/cl-jupyter/issues/22#issuecomment-239338505, or mute the thread https://github.com/notifications/unsubscribe-auth/AACFkGeCgPaMpXRV1fw6xojBlpFtXehTks5qe8jIgaJpZM4JhV6b .

ZelphirKaltstahl commented 7 years ago

The precompiled version of SBCL works.

In the repositories of my fedora I found `zeromq-devel, but that is already installed.

Thanks for the info about rlwrap, I didn't know such an "in between" tool existed!

ZelphirKaltstahl commented 7 years ago

Ok, I got it running now. softlinking the shell script worked to make the installer find sbcl, since it is not installed from the repos:

ln -s /path/to/sbcl /usr/bin/sbcl

and after that I was able to run

jupyter notebook

in my virtualenv : ) and I can run the code in the example notebook, yay!

For what it's worth: I get some kind of warning in the shell:

WARNING: [Shell] message type 'comm_open' not (yet ?) supported, skipping...

Not sure what that means.

mmaul commented 7 years ago

Glad to hear it. I have some notebooks up at https://github.com/mmaul/clml.tutorials https://github.com/mmaul/clml.tutorials if you're interested..

On Fri, Aug 12, 2016 at 2:24 PM, Zelphir Kaltstahl <notifications@github.com

wrote:

Ok, I got it running now. softlinking the shell script worked:

ln -s /path/to/sbcl /usr/bin/sbcl

and after that I was able to run

jupyter notebook

in my virtualenv : ) and I can run the code in the example notebook, yay!

For what it's worth: I get some kind of warning in the shell:

WARNING: [Shell] message type 'comm_open' not (yet ?) supported, skipping...

Not sure what that means.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fredokun/cl-jupyter/issues/22#issuecomment-239523152, or mute the thread https://github.com/notifications/unsubscribe-auth/AACFkLtBbcNWWw_oYDxGg1UhGzaLm9pKks5qfLp6gaJpZM4JhV6b .

ZelphirKaltstahl commented 7 years ago

@mmaul definitely interested in ML in general, although I am still very much learning Common LISP. Might take a while until I can understand complex stuff. Thanks!

fstamour commented 7 years ago

I guess this issues could be closed?

ZelphirKaltstahl commented 7 years ago

I think so too.

fredokun commented 7 years ago

You're right ... was a little busy...