Set Up Python and the Practice Project
Why This Matters
Most beginner frustration is not Python, but setup: the wrong Python version, packages installed in the wrong place, a project that runs on one laptop and not another. Ten minutes of good setup saves days later, and the same habits keep automations reproducible in production.
What you need
| Tool | Why |
|---|---|
| Python 3.10 or newer | From python.org or your package manager. Check with python3 --version |
| An editor | Visual Studio Code with the Python extension works well |
| Git | To get the practice project and track your changes |
| An AI assistant | To explain code and errors |
The official Python tutorial is the best free reference when you want to look something up. You do not need to read it front to back.
Screenshot of docs.python.org.
Virtual environments: one project, one set of packages
A virtual environment is a folder with its own Python packages for one project. Without it, every project shares the same packages and sooner or later two projects need different versions.
git clone https://github.com/learn-automated-testing/order-intake-bot.git
cd order-intake-bot
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements-dev.txt
You see (.venv) in front of your prompt when the environment is active. Always activate it before you work on the project.
Check that everything works
python -m pytest
You should see 19 passed. If something fails, copy the full error into your AI assistant and ask: “Explain this error to a beginner and tell me what to try first.”
What is in the project
| Path | What it is |
|---|---|
intake/ | The bot: reading messages, the LLM step, rules, the ERP client and the pipeline |
tests/ | 19 pytest tests |
samples/ | Three supplier emails, and a recorded LLM answer for each |
data/catalog.json | Product catalogue with prices |
fake_erp.py | A small local stand-in for the ERP’s order API |
AGENTS.md | Rules for AI assistants (and people) working on the code |
Exercise
- Install Python 3.10 or newer and check the version.
- Clone the project, create and activate a virtual environment, and install the requirements.
- Run
python -m pytestuntil you see 19 passed. - Create a branch for your own work:
git switch -c my/python-course.
Key Takeaways
- Use Python 3.10 or newer, and one virtual environment per project.
pip install -r requirements-dev.txtmakes the setup reproducible.python -m pytestis your first check: 19 passed.- Ask AI to explain errors, not just to fix them.
