This issue as bee resolved by Hackerspolit on udemy.
It seems I had made rookie mistake and need to install full socket module
with pip3 install sockets.
I still had further problems when running this script due to ord() function.
I believe this was due to:
Python 3 the sock.recvfrom(...) call returns bytes while Python 2.7 recvfrom returns a string. So ord did not change but what is being passed to ord has changed.