Question: you must tty to run sudo?
Answer: Replace Defaults requiretty by Defaults ! requiretty in your /etc/sudoers. This will impact the global sudo configuration.
Alternatively, this configuration can be changed at a per user, per group or per command basis.