Installing and Testing

Most users will want to simply install the latest version, hosted on PyPI:

pip install peewee

Peewee comes with two C extensions that can optionally be compiled:

  • Speedups, which includes miscellaneous functions re-implemented with Cython. This module will be built automatically if Cython is installed.
  • Sqlite extensions, which includes Cython implementations of the SQLite date manipulation functions, the REGEXP operator, and full-text search result ranking algorithms. This module should be built using the build_sqlite_ext command.


If you have Cython installed, then the speedups module will automatically be built. If you wish to also build the SQLite Cython extension, you must manually run:

python build_sqlite_ext
python install

Installing with git

The project is hosted at and can be installed using git:

git clone
cd peewee
python install

If you would like to build the SQLite extension in a git checkout, you can run:

# Build the sqlite extension and place the shared library alongside the other modules.
python build_sqlite_ext -i


On some systems you may need to use sudo python install to install peewee system-wide.

Running tests

You can test your installation by running the test suite.

python test

# Or use the test runner:

You can test specific features or specific database drivers using the script. By default the test suite is run using SQLite and the playhouse extension tests are not run. To view the available test runner options, use:

python --help