goncalopp / keystroke_dynamics

a keystroke dynamics algorithm in python (recognizes a person by the way s/he types)
31 stars 22 forks source link

Xlib.error.DisplayNameError #2

Closed nocLyt closed 9 years ago

nocLyt commented 9 years ago

Hi. when I run example.py, I got an error.

Traceback (most recent call last):
  File "example.py", line 1, in <module>
    import capture_keys
  File "/Users/yiyi/soft/keystroke_dynamics/capture_keys.py", line 8, in <module>
    local_dpy = display.Display()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Xlib/display.py", line 83, in __init__
    self.display = _BaseDisplay(display)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Xlib/display.py", line 65, in __init__
    apply(protocol.display.Display.__init__, (self, ) + args, keys)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Xlib/protocol/display.py", line 44, in __init__
    name, host, displayno, screenno = connect.get_display(display)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Xlib/support/connect.py", line 65, in get_display
    return mod.get_display(display)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Xlib/support/unix_connect.py", line 59, in get_display
    raise error.DisplayNameError(display)
Xlib.error.DisplayNameError: Bad display name ""

I think is the version of python-xlib isn't right. Could you tell me which version you used?

goncalopp commented 9 years ago

Are you sure it's not a env problem?

What's the output of echo $DISPLAY on the console where you're running the program?

sandeepsign commented 7 years ago

HI Goncolopp,

Even I am getting the same issue and when I do echo $DISPLAY, I am seeing empty value. I am running in MAC terminal. Do I need to set DISPLAY to some value?

Sorry if this question is too basic. I am bit new to MAC world.

Thanks Sandeep

goncalopp commented 7 years ago

HI sandeepsign,

As the README states, you need the X windowing system (X11), and one that supports the RECORD extension.

As far as I know, macs don't ship X by default. XQuartz seems to be the go-to X server on mac, but this question seems to imply it doesn't support the RECORD extension, unfortunately

If you're willing to do some development to get this to work across platforms, you might want to check my explanation on #3 for a possible way to adapt the code. Otherwise, I'm afraid you'll have to stick to running some variant of linux

shiva11344 commented 5 years ago

run it on linux and check once