self-operating-computer icon indicating copy to clipboard operation
self-operating-computer copied to clipboard

[BUG] No such file or directory Xauthority

Open devinat1 opened this issue 1 year ago • 2 comments

Describe the bug

On WSL, I create a virtual environment and install packages then run the "operate" command which leads to an error that there is no Xauthority.

Steps to Reproduce

  1. python3.10 -m venv venv
  2. source venv/bin/activate
  3. pip install self-operating-computer
  4. operate

Expected Behavior

Runs and opens GUI

Actual Behavior:

Crash:

Traceback (most recent call last):
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/Xlib/xauth.py", line 43, in __init__
    raw = open(filename, 'rb').read()
FileNotFoundError: [Errno 2] No such file or directory: '/home/bond/.Xauthority'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bond/cs590/self-operating-computer/venv/bin/operate", line 5, in <module>
    from operate.main import main_entry
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/operate/main.py", line 6, in <module>
    from operate.operate import main
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/operate/operate.py", line 25, in <module>
    from operate.utils.operating_system import OperatingSystem
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/operate/utils/operating_system.py", line 1, in <module>
    import pyautogui
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/pyautogui/__init__.py", line 246, in <module>
    import mouseinfo
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/mouseinfo/__init__.py", line 223, in <module>
    _display = Display(os.environ['DISPLAY'])
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/Xlib/display.py", line 80, in __init__
    self.display = _BaseDisplay(display)
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/Xlib/display.py", line 62, in __init__
    display.Display.__init__(*(self, ) + args, **keys)
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/Xlib/protocol/display.py", line 60, in __init__
    auth_name, auth_data = connect.get_auth(self.socket,
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/Xlib/support/connect.py", line 91, in get_auth
    return mod.get_auth(sock, dname, host, dno)
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/Xlib/support/unix_connect.py", line 103, in new_get_auth
    au = xauth.Xauthority()
  File "/home/bond/cs590/self-operating-computer/venv/lib/python3.10/site-packages/Xlib/xauth.py", line 45, in __init__
    raise error.XauthError('~/.Xauthority: %s' % err)
Xlib.error.XauthError: ~/.Xauthority: [Errno 2] No such file or directory: '/home/bond/.Xauthority'

Environment

  • OS: WSL
  • Model Used (e.g., GPT-4v, Gemini Pro Vision): Not yet input

devinat1 avatar Apr 04 '24 17:04 devinat1

on wsl: no fix install x correctly (CANT DO)

ON LINUX: xhost +local:$USER

slapglif avatar Dec 02 '24 02:12 slapglif

This also happens due to the use of wayland on your system. Change wayland for X11 and youre ready to go.

Koolkatze avatar Feb 08 '25 19:02 Koolkatze