Install SQLModel

Install the SQLModel package and verify the installation

💻

Writing code and entering commands is only available on desktop. Open this page on a larger screen to complete this chapter.

What you are installing

SQLModel is the only new dependency for this course. It bundles everything needed to connect Python classes to a SQLite database:

IncludedPurpose
SQLModelMaps Python classes to database tables
SQLAlchemyThe database engine SQLModel builds on
Pydantic v2Validation — you already have this from FastAPI

After installing, verify the package is available by printing its version.

Instructions

Install SQLModel and verify the installation.

  1. Install sqlmodel with pip install sqlmodel.
  2. Verify the installation by running python -c "import sqlmodel; print(sqlmodel.__version__)".