Issue with Macaulay2 instillation - Windows 10

69 views
Skip to first unread message

Kieran Bhaskara

unread,
Apr 28, 2021, 11:04:19 AM4/28/21
to Macaulay2
Hi,

I'm trying to setup Macaulay2 on my Windows 10 laptop. I've tried to follow the instructions listed here and here. I used the commands 

sudo add-apt-repository ppa:macaulay2/macaulay2  
sudo apt install macaulay2

in bash to install, but then when I type M2, I get the following. Does anyone know what I did wrong or how to fix this? I am running WSL 2.

Best,
Kieran

M2.png

jche...@gmail.com

unread,
Apr 28, 2021, 11:17:18 AM4/28/21
to Macaulay2
Hi Kieran,

This shouldn't be much of an issue - the errors displayed there should not really affect running commands in M2. I believe the problem comes from the PATH variable containing parentheses (you can check this in bash by running "echo $PATH" - the common culprits are paths from Windows like "Program Files (x86)" and the like). But you should still be able to use M2 just fine.

Justin

Kieran Bhaskara

unread,
Apr 28, 2021, 11:28:59 AM4/28/21
to Macaulay2
Hi Justin,

Thanks so much! Is there a way to confirm that M2 will actually run? To be honest, I'm still not completely sure how to actually get to M2 from this point: the instructions I listed above say to set up emacs and install Xming, but I wanted to make sure I had done the initial setup correctly. If I continue and download this additional software, where do I actually use M2 from?

Kieran

jche...@gmail.com

unread,
Apr 28, 2021, 11:54:38 AM4/28/21
to Macaulay2
Hi Kieran,

Your screenshot shows that M2 is already running - this is indicated by the prompt "i1 : ". You can use M2 interactively (i.e. type commands at the prompt, press enter, and wait for the output) in the terminal, which is easiest for quick sessions. One can also run M2 within Emacs, but this is more cumbersome on Windows (Emacs under Xming has some strange display features).

(I should also mention: if you want to remove the error messages, you can edit the PATH variable, which is the route I take on my machine.)

Justin

Kieran Bhaskara

unread,
Apr 28, 2021, 12:57:55 PM4/28/21
to Macaulay2
Hi Justin,

Thanks for this, this is helpful! Two last things:

1. How do you edit the PATH variable?
2. If I want to write a chunk of code and execute in one go, how do I do this? With Maple, for example, one can save worksheet files and select sections of the files to execute. Is there a way to do that with M2 without running each command separately? Should you copy code to a text file to save it?

Thanks so much for your help,
Kieran

Doug Torrance

unread,
Apr 28, 2021, 12:58:15 PM4/28/21
to Macaulay2
FYI, the parentheses in PATH issue under Windows is fixed in git and will no longer be a problem in Macaulay2 1.18, which I believe is planned to be released next month.

jche...@gmail.com

unread,
Apr 28, 2021, 2:52:26 PM4/28/21
to Macaulay2
Hi Kieran,

1) For editing the PATH variable, cf. e.g. https://opensource.com/article/17/6/set-path-linux (although this will soon be unnecessary, as per Doug's comment)
2) You can save M2 code to a file with extension .m2 (as plaintext), and then load the entire file with the command "load": cf. https://faculty.math.illinois.edu/Macaulay2/doc/Macaulay2-1.17/share/doc/Macaulay2/Macaulay2Doc/html/_load.html

Justin

Kieran Bhaskara

unread,
Apr 28, 2021, 9:01:23 PM4/28/21
to Macaulay2
Thanks Justin and Doug,

I saved some code to file, but I'm not sure where to place it so that it reads it. Currently I get the error "file not found on path." According to your linked instructions, I can place it in the current directory, which I confirmed to be home/kieran (for Ubuntu app) or /mnt/c/WINDOWS/system32/ (for bash). But I'm not sure where to go from here.

Thanks again for your help,
Kieran
Reply all
Reply to author
Forward
0 new messages