CSE Roadmap

Common tier · about 6 hours · 8 parts

Part 1 of 8 · 2 min read

Overview

In this module you will

  • Explain why "it works on my machine" happens, and how a virtual environment prevents it.
  • Set up a Python project that another person can install and run with a few commands.
  • Read a pyproject.toml file line by line.
  • Lay out a project so that code, tests and settings each have an obvious home.
  • Describe data with type hints and Pydantic models, so that bad input fails early with a clear message.

Why this matters for agents

An agent is ordinary software with a model call in the middle. It reads messages, calls tools, stores state and returns answers. Almost all agent frameworks and model SDKs are Python libraries, and they change quickly.

If your project cannot be installed the same way twice, you will lose hours to "it works on my machine" before you ever reach the interesting part. This module is about the plain habits that stop that from happening.

The problem: it works on my machine

You write a small program. It uses a few libraries, such as a tool for talking to a web service. It runs fine. You send it to a friend, or you move it to a server, and it crashes:

ModuleNotFoundError: No module named 'pydantic'

or, worse, it runs but behaves differently, because your friend has an older version of one library. Nothing is wrong with the code. The two computers are simply set up differently: a different Python version, different libraries installed, different versions of those libraries.

Almost every professional Python habit in this module exists to remove that difference. First, some words you will see all the time.

Library and package

A library is code written by other people that you can use in your own program, for example a library for talking to web services or for checking data. In Python a library is shipped as a package: a folder of Python files that you can import.

pip and PyPI

PyPI (the Python Package Index) is the public store of Python packages. pip is the tool that downloads a package from it and installs it. pip install pydantic means "fetch the package called pydantic and install it".

Terminal

A window where you type commands instead of clicking. On Windows you can use Command Prompt, PowerShell or Git Bash. On macOS and Linux it is called Terminal. Lines that start with $ in this course are things you type. Do not type the $.

Check yourself

  • Name two things that can differ between your computer and a teammate's, and make the same program behave differently.
  • What is PyPI, and what is pip?