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.
pyCharm
sudo pycharm.sh
I
In PyCharm new version, it has a configure to run Python interpreter in root, no need workaround. See picture below. Check to checkbox: Execute code using this interpreter with root privileges via sudo