OthersideAI / self-operating-computer

A framework to enable multimodal models to operate a computer.
https://www.hyperwriteai.com/self-operating-computer
MIT License
8.21k stars 1.09k forks source link

[BUG] No such file or directory Xauthority #186

Open devinat1 opened 3 months ago

devinat1 commented 3 months ago

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