Setup and Run Macaulay 2

Here are some tips for getting started with Macaulay 2:

Installation and usage with Jupyter notebook on WSL

This was taken from Annie Giokas discussion in this google forum post.

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 then you can install Jupyter by going 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

Installing Macaulay2 kernel

Now we need to install the Macaulay2 kernel for jupyter to recognize 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.

Installation and usage with Jupyter notebook on Mac

Installing Jupyter

Installing Macaulay2

Creating virtual environment

Notebook extensions

Installing Macaulay2 kernel

Previous
Next