Getting Started· 15 min
Windows setup
What you'll learn
- ▸Install Python on Windows with PATH enabled
- ▸Activate a venv in PowerShell
- ▸Run a Session 1 script end-to-end on Windows
Windows uses different commands for venv activation and path separators. Use PowerShell (not the old cmd.exe) for the best experience.
1. Install Python
- Download Python 3.12 from https://python.org/downloads/windows/
- During install, CHECK the box "Add Python to PATH" — this is critical.
- Open a new PowerShell window and run: python --version
2. Create a virtual environment
$ cd $HOME\Documents\AICourse\Session1
$ python -m venv .venv
$ .\.venv\Scripts\Activate.ps1
Execution policy error?
If PowerShell blocks the activate script, run this once: Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
3. Install dependencies
$ pip install -r requirements.txt
4. Create your .env file
$ Copy-Item .env.example .env
$ notepad .env
Paste your OPENAI_API_KEY and save.
5. Run a script
$ python src\01_text_basic.py --prompt "hello"
Note the backslash (\) in Windows paths. On macOS/Linux the same command uses forward slashes.