Skip to main content

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

ToolWhy
Python 3.10 or newerFrom python.org or your package manager. Check with python3 --version
An editorVisual Studio Code with the Python extension works well
GitTo get the practice project and track your changes
An AI assistantTo 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.

The Python Tutorial on docs.python.org, introducing Python as an easy to learn, powerful programming language

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

PathWhat 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.jsonProduct catalogue with prices
fake_erp.pyA small local stand-in for the ERP’s order API
AGENTS.mdRules for AI assistants (and people) working on the code

Exercise

  1. Install Python 3.10 or newer and check the version.
  2. Clone the project, create and activate a virtual environment, and install the requirements.
  3. Run python -m pytest until you see 19 passed.
  4. 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.txt makes the setup reproducible.
  • python -m pytest is your first check: 19 passed.
  • Ask AI to explain errors, not just to fix them.