Python Forum

Full Version: Socket Issue due to AF_UNIX
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I am on Windows and trying to run this Python Discord Bot script from github.

However, it appears that the socket is UNIX and therefore I get this error:

Traceback (most recent call last):
File "C:\Users\username\AppData\Local\Programs\Python\Python38-32\BOTNAME.py", line 43, in <module>
server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
NameError: name 'socket' is not defined


Will it not socket correctly because I'm on Windows? I have replaced instances of UNIX with INET instead and the script executed but it did not work correctly..

I have installed Cygwin and I'm using running the script there but then I receive this error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 76
async def on_ready():


I guess Cygwin doesn't understand async?

Any help appreciated!!
spacemaker18 Wrote:NameError: name 'socket' is not defined
This is impossible, because you have import socket at line 4.