I spend 6 hours yesterday, and about 3 hours today trying to get this bastard installed. Can I just say how much I hate Sqlite3 and its Python plumbing.
When you’re installing Python make sure you enable threads support at the start. Then install databases/py-sqlite3 for the sqlite default modules. Only then install trac.