Search code examples
pythonpycharminterpretereofcarriage-return

"/usr/bin/python^M: bad interpreter"


Cannot figure out, where to change EOF in PyCharm. My scripts start with :

#!/usr/bin/python
# -*- coding: utf-8 -*-

It outputs something like this when I try to run it like an executable (chmode +x) :

-bash: ./main.py: /usr/bin/python^M: bad interpreter: No such file or directory


Solution

  • Set line separator to Unix:

    Unix