NameError: name 'packages' is not defined