Symptom
A script that runs locally dies on the server with SyntaxError — a parse-time failure, so not a single line executes.
Cause
Shared hosting and older servers commonly default to 3.9. Your laptop is on 3.11-3.12.
| Syntax | Requires |
|---|---|
match / case | 3.10+ |
| union type hints | 3.10+ |
tomllib | 3.11+ |
itertools.batched | 3.12+ |
Fix
python3 -V on the server firstpython3.9 -m py_compile *.py