Build first the library before packaging

Fixes the import error when using Python 3.