I have this problem where im trying to run a python script through shell and it keeps coming out with

sh: 1: Syntax error: "(" unexpected

I think this may be caused by DM or the shell not honoring the shebang at the beginning of the file which is set as #!/usr/bin/env python3
I also asked and confirmed this on stackexchange that it is DM causing the issue here, not the python scripts themselves.