I found that this file is missing a line of code, which causes the .py file to be executed with bash by default. Add the following code to the file: #!/usr/bin/env python