Setting up Jupyter for Macaulay2

Skip to first unread message

Annie Giokas

Jan 20, 2022, 8:31:59 PMJan 20
to Macaulay2
Hi everyone, 

I tried using Jupyter for Macaulay2 last year and it was really useful for presentations and making notes. 

Here are the instructions, tell me if it works for you:

Installing Jupyter

Install Anaconda on wsl which will manage python versions and jupyter. This is recommended since this will allow the browser to work correctly since using jupyter separately caused some issues when using the browser, such as notebook files not opening. You can install anacdonda by following the instructions here: or here:

After you install anacdonda on wsl server:

conda install -c conda-forge notebook

Update your package manager:

$ sudo apt update

Then install pip3:

$ sudo apt install python3-pip

Install jupyter using apt again:

$ sudo apt install jupyter

Now we need to install the Macaulay2 kernel for jupter to recodnize the Macaulay2 code and make notebooks using that kernel available. Make sure you run this as root (Add sudo at the beginning), because it tries to put files in system diretories:

$ sudo pip3 install macaulay2-jupyter-kernel $ sudo python3 -m m2_kernel.install

Then to make a new notebook, type:

$ jupyter notebook

If you fixed the browser to work on wsl, it should redirect you to your chosen browser in Windows. Then you should be able to make an M2 file in jupyter.

You can also try using the VS code extension for jupyter:


Mar 27, 2022, 2:37:38 PMMar 27
to Macaulay2
Thank you for the information. I could add the kernel, but I get the "KERNEL ENFORCED TIMEOUT" message for some "large" computations. Do you know how to resolve this?


It only happens in the JupyterLab/Notebook, but not in the terminal. 

Reply all
Reply to author
0 new messages