When you said you are trying it on the local computer do you mean kali? Or which exact computer?
Also I’ll suggest to write the code as showed in the course, I mean import scapi.all as scapy, and your mod function seems a bit odd, why are you getting the payload ther? and why are you converting it to bytes using utf-8? Are you using python 2 or 3?
Let me know.