Q:

AttributeError: type object 'socket' has no attribute 'socket'

import socket
from socket import *

conn = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.ntohs(3))

I'm facing this error:
AttributeError: type object 'socket' has no attribute 'socket'

A:

If you import all library don't need to name library before method:
from socket import *
socket.socket # AttributeError: type object 'socket' has no attribute 'socket'
from socket import *
socket # <class 'socket.socket'>

or maybe :
import socket
socket.socket # <class 'socket.socket'>

