This is a Python cffi port of libtcod.

This library is hosted on GitHub.

Any issues you have with this module can be reported at the GitHub issue tracker.


This module was designed to be backward compatible with the original libtcodpy module distributed with libtcod. If you had code that runs on libtcodpy then you can use this library as a drop-in replacement:

import tcod as libtcod

Guides and Tutorials for libtcodpy should work with the tcod module.

The latest documentation can be found here.


The recommended way to install is by using pip. Older versions of pip will have issues installing tdl, so make sure it’s up-to-date.

Windows / MacOS

To install using pip, use the following command:

> python -m pip install tdl


The easiest method to install tdl on Linux would be from the PPA, this method will work for the Zesty, Artful, and Bionic versions of Ubuntu:

$ sudo add-apt-repository ppa:4b796c65/ppa
$ sudo apt-get update
$ sudo apt-get install python-tdl python3-tdl

Otherwise tdl will need to be built from source. Assuming you have Python, pip, and apt-get, then you’ll run these commands to install tdl and its dependencies to your user environment:

$ sudo apt-get install gcc python-dev python3-dev libsdl2-dev libffi-dev libomp-dev
$ pip2 install --user tdl
$ pip3 install --user tdl


  • Python 2.7+, Python 3.4+, or PyPy 5.4+
  • Windows, Linux, or MacOS.
  • On Linux, requires libsdl2 to run.


python-tdl is distributed under the Simplified 2-clause FreeBSD license.