I have an application that uses pyautogui that I've been asked to modify so that it doesn't use pyautogui for certain use cases where it's not required (getting more specific than this would be quite verbose).
The problem that I'm facing is import pyautogui fails with the error
XauthError: ~/.Xauthority: [Errno 2] No such file or directory: '/home/sam/.Xauthority'
if X11 is not available.
I'd argue this failure should not occur at import time; it should occur when attempts to actually use pyautogui functionality are made.
I have an application that uses pyautogui that I've been asked to modify so that it doesn't use pyautogui for certain use cases where it's not required (getting more specific than this would be quite verbose).
The problem that I'm facing is
import pyautogui
fails with the errorif X11 is not available.
I'd argue this failure should not occur at import time; it should occur when attempts to actually use pyautogui functionality are made.
See also https://github.com/asweigart/pyautogui/issues/111