Can you please post your code here? Which device/companion computer are you using? Are you running this script onboard the companion computer?
Have you looked at sample python apps from developers section in FlytOS docs?
This issue shows that ROS wasn’t running when you ran your script. Please provide more details so that I can figure out what went wrong.