If anyone is having the same issue, make sure not to just open the ui file in QtCreator. Open the folder containing the file as a workspace such that QtCreator can configure the project as a Qt 5.xx project. After that, pyuic5 should work as expected.