I’m having issues importing pyautogui after installing it.
Output of hostnamectl
:
Static hostname: archlinux
Icon name: computer-laptop
Chassis: laptop 💻
Machine ID: feee6bbdd3b94cdd9de25a09801e7fb8
Boot ID: 463321eb08054209ad65b5b793c8727f
Operating System: Arch Linux
Kernel: Linux 6.11.5-arch1-1
Architecture: x86-64
Hardware Vendor: HP
Hardware Model: HP Laptop 15-bs2xx
Firmware Version: F.40
Firmware Date: Wed 2018-05-16
Firmware Age: 6y 5month 1w 5d
Here is the error I’m getting when trying to import the pyautogui module:
>>> import pyautogui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/curtis/Documents/python_projects/test/venv/lib/python3.12/site-packages/pyautogui/__init__.py", line 246, in <module>
import mouseinfo
File "/home/curtis/Documents/python_projects/test/venv/lib/python3.12/site-packages/mouseinfo/__init__.py", line 223, in <module>
_display = Display(os.environ['DISPLAY'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/curtis/Documents/python_projects/test/venv/lib/python3.12/site-packages/Xlib/display.py", line 80, in __init__
self.display = _BaseDisplay(display)
^^^^^^^^^^^^^^^^^^^^^
File "/home/curtis/Documents/python_projects/test/venv/lib/python3.12/site-packages/Xlib/display.py", line 62, in __init__
display.Display.__init__(*(self, ) + args, **keys)
File "/home/curtis/Documents/python_projects/test/venv/lib/python3.12/site-packages/Xlib/protocol/display.py", line 129, in __init__
raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'Authorization required, but no authorization protocol specified\n'
I’m unsure on where to start with this error. So any direction would be greatly appreciated.