It turns out this error was caused by the line .mod csv in my .sqliterc file. So there is a simple work-around. But the error message is unhelpful.