返回 ppt-master
windows-installation.md
根目录 / docs / windows-installation.md
1 # Windows Installation Guide
2
3 [English](./windows-installation.md) | [Chinese](./zh/windows-installation.md)
4
5 ---
6
7 This guide walks you through installing PPT Master on Windows step by step. Follow along and you'll have a working setup in under 10 minutes.
8
9 ---
10
11 ## Step 1 — Install Python (Required)
12
13 Python is the only hard requirement.
14
15 1. Go to **[python.org/downloads](https://www.python.org/downloads/)** and download the latest **Python 3.10+** installer.
16
17 2. **⚠️ CRITICAL: Check "Add python.exe to PATH"** during installation — this is the single most common mistake on Windows. Skipping this will break every step that follows.
18
19 3. After installation, open **PowerShell** (search "PowerShell" in Start menu) and verify:
20
21 ```powershell
22 python --version
23 ```
24
25 You should see `Python 3.12.x` or similar. If you see "Python was not found" or it opens the Microsoft Store, see [Troubleshooting](#python-was-not-found-or-opens-microsoft-store) below.
26
27 > **💡 Tip**: Python installed via Anaconda or Miniconda works too — just make sure `python --version` shows 3.10+.
28
29 ---
30
31 ## Step 2 — Download the Project
32
33 **Option A — Download ZIP** (easiest):
34
35 1. Go to [github.com/hugohe3/ppt-master](https://github.com/hugohe3/ppt-master)
36 2. Click the green **Code** button → **Download ZIP**
37 3. Unzip to `C:\Users\YourName\ppt-master`
38
39 **Option B — Git Clone** (requires [Git](https://git-scm.com/downloads)):
40
41 ```powershell
42 git clone https://github.com/hugohe3/ppt-master.git
43 cd ppt-master
44 ```
45
46 ---
47
48 ## Step 3 — Install Dependencies
49
50 ```powershell
51 cd C:\Users\YourName\ppt-master # ← adjust to your actual path
52 pip install -r requirements.txt
53 ```
54
55 > If `pip` is not recognized, try `python -m pip install -r requirements.txt`.
56
57 Wait for it to finish. You should see `Successfully installed ...` at the end.
58
59 ---
60
61 ## Step 4 — Verify Your Setup
62
63 ```powershell
64 python -c "import pptx; import fitz; print('All core dependencies OK')"
65 ```
66
67 ✅ Output: `All core dependencies OK` → you're good.
68
69 ❌ Error → see [Troubleshooting](#troubleshooting) below.
70
71 ---
72
73 ## Step 5 — Run a Minimal Example
74
75 Open the `ppt-master` folder in an agent-capable AI tool (Claude Code, Codex, Cursor, a VS Code agent, etc.) and type in the chat:
76
77 ```
78 Quickly generate a simple 3-page test PPT with a cover, one content page, and a closing page. Topic: "Hello World". No need to confirm with me.
79 ```
80
81 Asking for **quick generation** is what keeps this smoke test short: the AI skips the Strategist analysis and the design-confirmation round trips and goes straight to authoring and export. The default flow confirms the design spec with you first, which is what you want for a real deck but slow when all you are checking is that the environment works. Full guide → [Quick mode](./getting-started.md#quick-mode).
82
83 When it finishes, you should see:
84
85 - A native DrawingML `.pptx` under `exports/`, generated from `svg_output/`, that opens in PowerPoint and remains editable element by element.
86
87 That's the check that matters — if the file is there and opens, **you're done.** Note that quick generation skips `finalize_svg.py`, so there is no `svg_final/` preview directory; the default flow produces one, containing self-contained visual-preview SVGs. They may be inserted manually as SVG pictures, but manual "Convert to Shape" is outside the supported contract.
88
89 ---
90
91 ## Step 6 — Optional Enhancements (most users can skip this)
92
93 With Python and `requirements.txt` installed, you already have everything needed to generate presentations. PPTX export writes native DrawingML shapes, so it does not require CairoSVG, GTK, or a separate SVG rasterization stack. The item below is an **edge-case fallback** — install it only if you hit the specific scenario.
94
95 | Enhancement | Install only if… | How to install | Verify |
96 |-------------|-----------------|----------------|--------|
97 | **Pandoc** — legacy document formats | You need to convert `.doc`, `.odt`, `.rtf`, `.tex`, `.rst`, `.org`, or `.typ`. `.docx`/`.html`/`.epub`/`.ipynb` work natively in Python. | Download `.msi` from [pandoc.org](https://pandoc.org/installing.html) | `pandoc --version` |
98
99 ---
100
101 ## Troubleshooting
102
103 ### `python` was not found or opens Microsoft Store
104
105 **Cause**: Python isn't in your system PATH.
106
107 **Fix 1** — Re-run the Python installer → **Modify** → check **"Add Python to environment variables"**.
108
109 **Fix 2** — Manually add to PATH:
110 1. Run `where python` in PowerShell first to find the actual path (e.g. `C:\Users\YourName\AppData\Local\Programs\Python\Python312\python.exe`)
111 2. Search "Environment Variables" in Start menu
112 3. Find `Path` → **Edit** → add the **directory** from step 1 and its `Scripts` subfolder:
113 ```
114 C:\Users\YourName\AppData\Local\Programs\Python\Python312
115 C:\Users\YourName\AppData\Local\Programs\Python\Python312\Scripts
116 ```
117 4. Click OK, then **restart PowerShell**
118
119 **Fix 3** — Try `python3` or `py` instead.
120
121 ### A `python3` command fails (exit 49 / opens Microsoft Store)
122
123 The python.org installer ships `python.exe` but not `python3.exe`. **Just replace `python3` with `python` in the command** (the AI agent usually switches to `python` and continues on its own too).
124
125 ### `pip install` fails with permission errors
126
127 ```powershell
128 pip install --user -r requirements.txt
129 ```
130
131 Or run PowerShell as Administrator.
132
133 ### `pip install` fails due to network issues
134
135 ```powershell
136 pip install -r requirements.txt --proxy http://your-proxy:port
137 ```
138
139 ### `ModuleNotFoundError`
140
141 `pip` installed to a different Python. Use `python -m pip install -r requirements.txt` to match.
142
143 ### `import fitz` fails
144
145 1. Upgrade pip: `python -m pip install --upgrade pip`
146 2. Pre-built wheel: `pip install PyMuPDF --only-binary :all:`
147 3. Still failing → install [Visual C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
148
149 ### PowerShell says "running scripts is disabled"
150
151 ```powershell
152 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
153 ```
154
155 ---
156
157 ## Still stuck?
158
159 - 📖 [FAQ](./faq.md)
160 - 🐛 [GitHub Issues](https://github.com/hugohe3/ppt-master/issues) — include your Python version, Windows version, and full error message
161 - 💬 [GitHub Discussions](https://github.com/hugohe3/ppt-master/discussions)
162
162 lines MARKDOWN