It appears that you’ve named your own file socket.py
, so when you import socket
, you’re not getting the system library (it’s just re-importing the file you’re currently in – which has no AF_INET
symbol). Try renaming your file something like mysocket.py
.