You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Linux系统的Jupyter Notebook中安装Common-Lisp

Setting Up Common Lisp Kernel for Jupyter Notebook on Linux

Hey there! I’ve gone through this setup a few times, so let’s break down exactly how to get a Common Lisp notebook environment running in Jupyter on your Linux system. Here’s the step-by-step process:

Prerequisites

First, make sure you have these basics covered:

  • A working Linux distribution (Debian/Ubuntu, Fedora, Arch, etc.)
  • Python 3 and pip installed (Jupyter is Python-based, so these are non-negotiable)
  • A Common Lisp implementation (we’ll use SBCL, the most widely adopted and reliable option)

Step 1: Install Jupyter Notebook

If you don’t already have Jupyter set up, install it using pip3—using a virtual environment is recommended to avoid messing with system-wide dependencies, but a system install works too:

pip3 install jupyter

Step 2: Install SBCL (Common Lisp Implementation)

SBCL is a fast, open-source Common Lisp compiler. Install it via your distro’s package manager:

  • For Debian/Ubuntu-based systems:
    sudo apt update && sudo apt install sbcl
    
  • For Fedora:
    sudo dnf install sbcl
    
  • For Arch Linux:
    sudo pacman -S sbcl
    

Step 3: Set Up Quicklisp (Lisp Package Manager)

Quicklisp is the go-to package manager for Common Lisp, and we’ll need it to install the Jupyter kernel. Here’s how to get it running:

  1. Download the Quicklisp installation script:
    curl -O https://beta.quicklisp.org/quicklisp.lisp
    
  2. Launch SBCL and run the installation:
    sbcl --load quicklisp.lisp
    
    Once inside the SBCL REPL (the interactive Lisp prompt), run these commands:
    (quicklisp-quickstart:install)
    (ql:add-to-init-file)
    
    This installs Quicklisp and configures it to load automatically every time you start SBCL.

Step 4: Install the Common Lisp Jupyter Kernel

We’ll use cl-jupyter, the official and most maintained Common Lisp kernel for Jupyter. Here’s how to install it:

  1. Launch SBCL again:
    sbcl
    
  2. Load cl-jupyter via Quicklisp:
    (ql:quickload :cl-jupyter)
    
  3. Install the kernel into Jupyter’s system:
    (cl-jupyter:install :user t)
    
    The :user t flag installs the kernel only for your account (no sudo needed). If you want a system-wide installation accessible to all users, omit this flag and run SBCL with sudo.

Step 5: Verify the Installation

Start Jupyter Notebook to confirm everything works:

jupyter notebook

In the Jupyter web interface, click the "New" button in the top-right corner—you should see "Common Lisp" listed as an option. Click it to open a new notebook, then test with a simple expression like:

(+ 1 2 3 4)

Run the cell, and you should get 10 as the output.

Troubleshooting Tips

  • If you hit permission errors during kernel installation, double-check that you used :user t or ran SBCL with sudo for system-wide installs.
  • If cl-jupyter doesn’t show up in Quicklisp, update your Quicklisp client first by running (ql:update-all) in the SBCL REPL.
  • If Jupyter doesn’t detect the kernel, restart Jupyter and verify the kernel files exist in ~/.local/share/jupyter/kernels/common-lisp/.

内容的提问来源于stack exchange,提问作者Matheus Popst de Campos

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 07:13:30