python3 -m venv .venv
source .venv/bin/activate
python -m pip install python-dotenv requests
touch .env .env.example requirements.txtLESSON 05 · AI FOUNDATIONS
Set Up Python
A clean environment prevents dependency confusion and gives your AI project a predictable place to run.
Goal: Create a safe development environment30 minOutput: Environment health-check script
API_KEY="put_real_key_in_dotenv"
PUBLIC_BASE_URL="http://127.0.0.1:8000"- Never commit .env.
- Commit .env.example with safe placeholder values.
- Print only safe health checks; never print credentials.
Build a small script that loads an environment variable and exits clearly if it is missing.
LEARNING CHECKPOINT
Capture the deliverable before moving on.
Environment health-check script is your evidence that this lesson has been applied, not just read.
✓ PRACTICAL OUTPUT