How to get Python working on school lab machines — including no-internet (offline) install, which is the common case.
Before installing anything, check each machine:
Windows:
python --version
- If it prints something like
Python 3.12.x→ already installed, done. - If it says
'python' is not recognized→ trypy --version. If that works, Python is installed but the command name ispy:py -3 code-examples\lesson01_hello_world.py - If neither works → install (below).
Linux (some labs run Ubuntu):
python3 --version
Use python3 on Linux, not python.
Windows — one time, on each machine:
- Go to https://www.python.org/downloads/ and download the latest Python 3.
- Run the installer.
- CRITICAL: tick "Add Python to PATH" before clicking Install. This is the #1 cause of "'python' is not recognized".
- Click Install Now.
- Verify: open a new terminal →
python --version.
Linux (Ubuntu/Debian):
sudo apt update
sudo apt install python3 idle3The standard approach in schools with no lab internet: download once at a place with internet, carry it on a USB drive, install on every machine.
- Download the Windows 64-bit installer from https://www.python.org/downloads/windows/.
Look for: Windows installer (64-bit), a file like
python-3.12.x-amd64.exe. - Copy it to a USB stick.
- (Optional, very useful) also copy the installer for IDLE's dependencies — none needed, IDLE ships with Python.
- Insert the USB, run the
.exe, tick "Add Python to PATH", Install Now. - Verify with
python --version. - When finished, move to the next machine.
Create a text file install.bat on the USB with this line, using your exact filename:
python-3.12.x-amd64.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0Double-clicking install.bat installs Python with no questions, PATH included, in ~1 minute. Then verify with python --version.
Copy the whole intro to python folder onto the USB and onto each machine's desktop (or a shared folder). Then students can run:
python code-examples\lesson01_hello_world.pyOn every machine, this must work:
python --version
python code-examples/lesson01_hello_world.pyExpected output starts with Hello, World!. If the Python output shows strange symbols for some characters, your console is using an old encoding — see "Windows console encoding" below.
Some Windows consoles (older cmd / regional settings) print errors when Python outputs é, ₹, or Devanagari text. Two fixes:
- In the terminal, set the code page once per session:
chcp 65001
- Permanent fix (one file, once per machine): add to your Python program's first line:
or configure Windows: Settings → Time & Language → Language & regional format → Administrative language settings → Change system locale → tick "Beta: Use Unicode UTF-8 for worldwide language support" → restart. (This applies system-wide, so check with your lab admin.)
# -*- coding: utf-8 -*-
If a computer is unavailable but a phone/hotspot has internet:
- Replit — https://replit.com — free account, full Python in the browser.
- Programiz compiler — https://www.programiz.com/python-programming/online-compiler/ — no account needed.
- W3Schools Tryit — https://www.w3schools.com/python/tryit.asp
These work on cheap Android phones and Chromebooks. Teach the same lessons, students type in the browser.
- One shared drive is better than copying to 40 desktops. If the school has a network share, put Python on each machine once, but keep the
intro to pythonpack on the shared drive. - Freeze the version. Don't let students install updates mid-term; the course works on any 3.x, but a fixed version avoids "it worked at home" confusion.
- IDLE vs terminal: beginners find IDLE easiest (bigger editor, colors). Teach IDLE for the first two weeks, then move to the terminal.
- Save everything: always File → Save before Run. A classic first-lab failure is "I typed a lot and lost it".
- Backup each machine's work to the shared drive or USB at the end of every practical class — files on lab PCs are not permanent.
| Symptom | Cause | Fix |
|---|---|---|
'python' is not recognized |
PATH not set | reinstall ticking "Add Python to PATH", or use py |
python opens Microsoft Store |
PATH points to Store stub | run the real installer again with PrependPath |
SyntaxError on first line |
file saved with wrong encoding | keep files as UTF-8 (default in IDLE) |
| IDLE won't open | corrupt install | reinstall; on Linux check idle3 installed |
| Python "not found" in cmd but works in IDLE | PATH not refreshed | open a new terminal after install |
.py files don't run on double-click |
no association | right-click → Open with → Python; or run from terminal |
| Program stops and does nothing | input() waiting |
type and press Enter — it's not frozen |