for me it was because my python script had #!/usr/bin/python but that symlink didn't exist on my system on a fresh install, I needed:
#!/usr/bin/python
sudo ln -n /usr/bin/python3 /usr/bin/python