matysek meant: you should not use "global" here, but define both "hiddenimports" and "datas" on module level.