How to Solve NameError: name 'SOCK_STREAM' is not defined -- socket
Solution: Import the 'SOCK_STREAM' module
To Solve the error, add the following line to the top of your code.
from socket import SOCK_STREAM
For more information:
Python socket SOCK_STREAM