Py2cairo is as someone on the web said "notoriusly hard to install". For coverage generation cairocffi bind works perfectly and it is a lot easier to install (works with just pip install + necessary dev libs) Example: https://github.com/tmuic/mlat-server/commit/024a52dd2abb658ae4c59fb82d49a78e6b2438c9