open-interpreter icon indicating copy to clipboard operation
open-interpreter copied to clipboard

the `DISPLAY` environment variable can be undefined

Open pminervini opened this issue 10 months ago • 0 comments

Describe the bug

the code assumes it's always defined, but often it's not (e.g., if you're logging in via ssh)

Reproduce

(base) pasquale@host:~$ interpreter

Open Interpreter 1.0.0
Copyright (C) 2024 Open Interpreter Team
Licensed under GNU AGPL v3.0

A modern command-line assistant.

Usage: i [prompt]
   or: interpreter [options]

Documentation: docs.openinterpreter.com
Run 'interpreter --help' for all options

> [sample instruction]
Traceback (most recent call last):
  File "/home/../miniconda3/lib/python3.12/site-packages/interpreter/tools/computer.py", line 14, in <module>
    import pyautogui
  File "/home/../miniconda3/lib/python3.12/site-packages/pyautogui/__init__.py", line 246, in <module>
    import mouseinfo
  File "/home/../miniconda3/lib/python3.12/site-packages/mouseinfo/__init__.py", line 223, in <module>
    _display = Display(os.environ['DISPLAY'])
                       ~~~~~~~~~~^^^^^^^^^^^
  File "<frozen os>", line 714, in __getitem__
KeyError: 'DISPLAY'
Failed to import pyautogui. Computer tool will not work.

Expected behavior

no KeyError: 'DISPLAY'

Screenshots

No response

Open Interpreter version

latest @development

Python version

3.12.7

Operating System name and version

GNU/Linux aarch64

Additional context

No response

pminervini avatar Dec 08 '24 23:12 pminervini