Easiest Way to Install SageMath-10.9 on Windows: WSL + Ubuntu‑24.04 Only 4 Scripts (Fully Automated)

asked 2026-05-25 08:39:58 +0200

ortollj gravatar image

updated 2026-06-06 08:29:01 +0200

--- Installation made with the help of AI Copilot

📎 Full HTML version on OneDrive

You can view or download the complete post (including formatted code blocks) here:
👉 asksagePost.html on OneDrive

🟦 Easiest way to install SageMath on Windows 11 (WSL + Ubuntu‑24.04)

This workflow installs SageMath 10.9 on Windows 11 using WSL + Ubuntu‑24.04, with full automation and reproducibility.
Only 4 PowerShell scripts are needed, all ASCII‑only and idempotent.

✔ What the scripts do

  1. forceUbuntuVersion.ps1
    Ensures WSL installs Ubuntu‑24.04 (not 22.04).

  2. install‑sage‑Jupyter.ps1
    Installs all dependencies, builds SageMath 10.9 from source, and installs Jupyter Notebook + JupyterLab.

  3. createFile‑sage_sh_scripts.ps1
    Automatically generates the two WSL launchers:

    • sage_nb.sh (Jupyter Notebook)
    • sage_lab.sh (JupyterLab)
      You do not need to edit these .sh files.
  4. createShortcut.ps1
    Creates Windows shortcuts that open Jupyter directly in Microsoft Edge.

✔ Why this method

  • Works with Python 3.12 (WSL recently upgraded from 3.11 → 3.12).
  • Fully reproducible, no manual steps.
  • Clean separation Windows ↔ WSL.
  • Safe to re‑run (idempotent).
  • No path issues, no BOM/CRLF problems.

📎 Full HTML version (recommended)

👉 https://onedrive.live.com/?redeem=aHR...

Try it — it just works. If you encounter an issue, report it in the comments.

Try it, you'll love it. if you encounter a problem, please report it in the comments of this post so everyone can benefit. Don't try to solve any potential issues without mentioning them, please.

github issue

Note: After recent WSL/Ubuntu-24.04 updates, Windows-launched WSL sessions start with a minimal PATH. Two fixes are now required for stable SageMath startup scripts:

Use the full path to SageMath in the .sh scripts: (adapt for your Linux user)

/home/ortollj/sage/sage/sage -n jupyter --no-browser

Use the full path to cmd.exe in the PowerShell launcher:

C:\Windows\System32\cmd.exe /c start msedge "$URL"

These two absolute paths make the workflow reliable from both WSL terminal and Windows shortcuts.

edit retag flag offensive close merge delete