# Writing Racket (Scheme) in Jupyter Notebooks

By Corey J. Gallon · 2024-10-06 · https://gallon.me/writing-racket-scheme-in-jupyter-notebooks.html

---

First, we’re going to install Jupyter.  As we don’t want to contaminate our global Python installation, we’ll do this in a venv

```bash
python -m venv venv
```

Now, let’s activate that bad boy:

```bash
source ./venv/bin/activate
```

Assuming you have Racket installed (see previous TIL — NB do not install via the Snap store … use `apt`!), install the Racket kernel for Jupyter:

```bash
raco pkg install iracket
```

Should your system complain about not having `libzmq5` installed:

```bash
sudo apt install libzmq5
```

Then, install the Racket kernel into Jupyter:

```bash
raco iracket install
```

Then, confirm that Jupyter sees the Racket kernel:

```bash
❯ jupyter kernelspec list
Available kernels:
  python3    /home/captivus/projects/sicp/venv/share/jupyter/kernels/python3
  racket     /home/captivus/.local/share/jupyter/kernels/racket
```

Now … we create a new Jupyter notebook in VSCode using the Command Palette:

![Command Palette New Jupyter Notebook.png](https://gallon.me/images/20241006_command_palette_new_jupyter_notebook.png)

In the top right of the notebook, select the kernel (it won’t say Racket when you start):

![Jupyter Notebook Select Kernel.png](https://gallon.me/images/20241006_jupyter_notebook_select_kernel.png)

You’ll be presented with these options:

![Jupyter Kernel Options.png](https://gallon.me/images/20241006_jupyter_kernel_options.png)

Select “Jupyter Kernel”, then select “Racket”:

![Jupyter Notebook Select Racket.png](https://gallon.me/images/20241006_jupyter_notebook_select_racket.png)

… and you’re up!
