Tuesday, April 8, 2014

sudo keeps PYTHONPATH

http://superuser.com/questions/363813/sudo-does-not-preserve-pythonpath


$visudo

Add Defaults env_keep += PYTHONPATH

Add user to the sudo list

$ visudo

It basically use vi to open /etc/sudoers with write permission

Add following:

root    ALL=(ALL) ALL
username  ALL=(ALL) ALL

If you directly open /etc/sudoers using vi, you need to change the file permission and then edit the file. Assume you system setup only read permission for /etc/sudoers