Macaulay2 on Windows

This page has been retired. If you got here from an external link, please ask the webmaster of that other site to remove their links. Thank you.

Below are instructions for installing Macaulay 2 in a Windows environment (95, 2000, XP, even Vista!), with the preferred emacs interface. This has worked for at least thirteen people since 2002 – please email us with questions.


This installation includes Macaulay2 version 0.92, which is not the most recent version. (As of July 2009, version 1.2 is the current one.) We’re not planning to update the installation, so if it is important to you to have the current version, please see the Macaulay2 home page for information about installation.

The version of emacs included in this file is also not current: it’s version 21.2, whereas the latest version (as of July 2009) is 22.3.

Rex Dieter has packaged Macaulay2 in Windows Installer format. (See the instructions in that directory.) That’s another option for Windows users looking to install M2. It’s still version 0.92, though.

The installation

  1. download the file “” here (right-click and save it to your C:\ directory). Note: the file is 23 Mb.
  2. Unzip the file to your C:\ directory. You can do this with one of the free unzip utilities widely available, like 7-zip. (You may already have one of these installed – try just double-clicking on and see what happens.)
  3. The unzipped file willl be automatically extracted to C:\Macaulay2-0.9.2. Note: this location is important, since several of the files in the distribution depend on M2 being located here, rather than in some subdirectory.
  4. Find the file C:\Macaulay2-0.9.2\_emacs. Depending on how you have set up your machine, it may be hidden. If so, change your preferences under the View menu.
  5. Copy the file C:\Macaulay2-0.9.2\_emacs to the C:\ directory (at the top level).
  6. Run the emacs program file in a window, by double-clicking C:\Macaulay2-0.9.2\emacs-21.2\bin\emacs.exe. (You can also do this from an MS-DOS prompt, but if you know enough to do that, you’re probably ok at this point.)
  7. When emacs starts, press the F12 key to start M2.

You’re up and running!


Some people, mostly users of Windows 95 and 98, get an error when they open emacs and press F12: the emacs buffer says, “Out of environment space,Out of environment space, Bad command or file name”. That’s no fun. It’s happening because you do not have enough memory available for the MS-DOS environment. The best solution is to follow the directions on this Microsoft webpage. This doesn’t always work, but does more often than not.

If you are comfortable editing Windows batch files, you might try the following solution, due to Jesús Gago Vargas: add the variables M2HOME and M2WINH to your autoexec.bat file. For example, you might add:

rem The slashes in the next line should be /
set M2HOME=c:/Macaulay2-0.9.2/lib/Macaulay2-0.9.2
rem The slashes in the next line should be \
set M2WINH=c:\Macaulay2-0.9.2\lib\Macaulay2-0.9.2

(changing the path according to your machine, of course). Editing autoexec.bat is risky business, so please be careful!


Thanks to Sunsook Noh for providing the zipped file, and Amelia Taylor for letting us know!