Search code examples
linuxpycharm

Debugging in pyCharm with sudo privileges?


I've tested code that requires root access in pyCharm by running sudo pycharm.sh but this is not the way I would recommend of doing so.

I know it's possible to debug with sudo privileges by running the python interpreter as sudo in pyCharm but how do we do this?


Solution

  • Create a shell script that does "sudo python" and forwards the arguments, and configure that script as a Python interpreter in PyCharm.

    Name of this shell script should start with python (source: http://forum.jetbrains.com/message/PyCharm-424-3).