C.W.K.
Stream
Lesson 09 of 10 · published

Installation and the sqlite3 CLI

~12 min · sqlite, cli, install

Level 0Scout
0 XP0/80 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Probably already installed

SQLite ships with macOS, most Linux distributions, and every Python install. Windows ships SQLite as part of the C runtime since Windows 10. You probably do not need to install anything to follow this quest.

What you might want is a newer SQLite than the system one. macOS in particular ships an older Apple-curated build (3.43 as of 2026) when current upstream is 3.53+. Newer versions matter for STRICT tables, JSONB, FTS5 trigram, and recent performance work.

  • macOSbrew install sqlite installs upstream into /opt/homebrew/opt/sqlite/bin/sqlite3. Add it to PATH or invoke explicitly.
  • Ubuntu / Debiansudo apt install sqlite3 libsqlite3-dev.
  • Fedora / RHELsudo dnf install sqlite sqlite-devel.
  • Windows — download the Precompiled Binaries zip from sqlite.org and add to PATH, or use winget install SQLite.SQLite.
  • Python's bundled SQLitepython -c 'import sqlite3; print(sqlite3.sqlite_version)'. To upgrade Python's bundled SQLite you typically rebuild Python against a newer libsqlite, or use pysqlite3-binary.
Tip: When something works in the CLI but not in Python (or vice versa), check both versions: sqlite3 --version and python -c 'import sqlite3; print(sqlite3.sqlite_version)'. The two often differ — STRICT tables, JSONB, and several PRAGMAs landed in specific versions.

Code

Confirm you have a recent SQLite·bash
# CLI version
sqlite3 --version
# 3.53.0 2026-04-01 ... (or older — Apple's macOS build lags upstream)

# Python's bundled libsqlite — sometimes different from CLI
python3 -c 'import sqlite3; print(sqlite3.sqlite_version, sqlite3.version)'
# 3.43.2 2.6.0   <- libsqlite version, then Python sqlite3 module version

# If you need newer in Python:
pip install pysqlite3-binary
python3 -c 'import pysqlite3; print(pysqlite3.sqlite_version)'
# 3.53.0
Open a fresh database and look around·bash
# Create / open the database
sqlite3 demo.db

# Inside the REPL — these are 'dot commands' (covered next lesson)
sqlite> .help
sqlite> .databases
sqlite> .tables
sqlite> .quit

External links

Exercise

Confirm three installation paths on your machine: (1) the system sqlite3 CLI version, (2) the libsqlite version Python's stdlib sqlite3 module is linked against, (3) the version you would get from a fresh brew install sqlite or your distro's package manager. Note any drift and decide which one you want to be your daily driver.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.