Getting the error {:error, :eacces} while trying to connect to an udp server on port 123

That python code does not specify the port to open on the client. If it did, there would have been a third argument to socket.socket. Leaving out the third argument, which is the port number on the client, is the equivalent to passing 0 as the port to :gen_udp.open.