Skip to content

Latest commit

 

History

History
124 lines (93 loc) · 5.54 KB

File metadata and controls

124 lines (93 loc) · 5.54 KB

Python Lab Setup Guide (Nepali Government Schools)

How to get Python working on school lab machines — including no-internet (offline) install, which is the common case.

1. Check what's already installed

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 → try py --version. If that works, Python is installed but the command name is py:
    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.

2. Standard install (online)

Windows — one time, on each machine:

  1. Go to https://www.python.org/downloads/ and download the latest Python 3.
  2. Run the installer.
  3. CRITICAL: tick "Add Python to PATH" before clicking Install. This is the #1 cause of "'python' is not recognized".
  4. Click Install Now.
  5. Verify: open a new terminal → python --version.

Linux (Ubuntu/Debian):

sudo apt update
sudo apt install python3 idle3

3. Offline install (no internet in the lab)

The 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.

Step 1 — Get the installer onto a USB drive

  • 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.

Step 2 — Install from the USB on each machine

  • Insert the USB, run the .exe, tick "Add Python to PATH", Install Now.
  • Verify with python --version.
  • When finished, move to the next machine.

Faster option: silent install (one double-click per 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=0

Double-clicking install.bat installs Python with no questions, PATH included, in ~1 minute. Then verify with python --version.

Step 3 — Copy the teaching pack too

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.py

4. First lesson check (do this before the first class)

On every machine, this must work:

python --version
python code-examples/lesson01_hello_world.py

Expected 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.

5. Making the Windows console behave (UTF-8)

Some Windows consoles (older cmd / regional settings) print errors when Python outputs é, , or Devanagari text. Two fixes:

  1. In the terminal, set the code page once per session:
    chcp 65001
  2. Permanent fix (one file, once per machine): add to your Python program's first line:
    # -*- coding: utf-8 -*-
    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.)

6. No lab machines at all? Browser alternatives

If a computer is unavailable but a phone/hotspot has internet:

These work on cheap Android phones and Chromebooks. Teach the same lessons, students type in the browser.

7. Lab management tips

  • 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 python pack 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.

8. Troubleshooting

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