Requires pygame, which isn't on pip: https://bitbucket.org/pygame/pygame/downloads The Tetris game part of this is based on https://gist.github.com/kch42/565419/download This project simplified that example and implemented the AI.