title: when i run the python file on startup using crontab i got the following error
body: <p>i installed the following packages,already
  sudo pip3 install pyautogui.
  and done the following settings in crontab,
  @reboot XAUTHORITY=/home/pi/.Xauthority DISPLAY=:0  sh /home/pi/ICUmedical/launcher.sh &gt;/home/pi/logs/cronlog 2&gt;&amp;1;</p>
  <pre><code>Traceback (most recent call last):
  File &quot;main.py&quot;, line 5, in &lt;module&gt;
  import pyautogui as ui
  File &quot;/usr/local/lib/python3.7/dist-packages/pyautogui/__init__.py&quot;, line 241, in &lt;module&gt;
  import mouseinfo
  File &quot;/usr/local/lib/python3.7/dist-packages/mouseinfo/__init__.py&quot;, line 223, in &lt;module&gt;
  _display = Display(os.environ['DISPLAY'])
  File &quot;/usr/local/lib/python3.7/dist-packages/Xlib/display.py&quot;, line 80, in __init__
  self.display = _BaseDisplay(display)
  File &quot;/usr/local/lib/python3.7/dist-packages/Xlib/display.py&quot;, line 62, in __init__
  display.Display.__init__(*(self, ) + args, **keys)
  File &quot;/usr/local/lib/python3.7/dist-packages/Xlib/protocol/display.py&quot;, line 129, in 
  __init__
  raise error.DisplayConnectionError(self.display_name, r.reason)
  Xlib.error.DisplayConnectionError: Can't connect to display &quot;:0&quot;: b'Invalid MIT-MAGIC- 
  COOKIE-1 key'
  </code></pre>