title: How to install PyAutoGUI on Fedora 27
body: <p>When I run</p>
  
  <pre><code>sudo pip3 install PyAutoGUI
  </code></pre>
  
  <p>I receive the following error</p>
  
  <pre><code>[root@localhost Projects]# sudo pip install pyautogui 
  WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead.
  Collecting pyautogui
    Using cached PyAutoGUI-0.9.36.tar.gz
      Complete output from command python setup.py egg_info:
      Traceback (most recent call last):
        File "&lt;string&gt;", line 1, in &lt;module&gt;
        File "/tmp/pip-build-ywXbn7/pyautogui/setup.py", line 6, in &lt;module&gt;
          version=__import__('pyautogui').__version__,
        File "pyautogui/__init__.py", line 115, in &lt;module&gt;
          from . import _pyautogui_x11 as platformModule
        File "pyautogui/_pyautogui_x11.py", line 7, in &lt;module&gt;
          from Xlib.display import Display
      ImportError: No module named Xlib.display
  
      ----------------------------------------
  Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ywXbn7/pyautogui/
  </code></pre>
  
  <p>I have followed other troubleshooting advice by installing Pillow and Display and using just the pip command.  </p>
  
  <p>I have also attempted installation of PyAutoGUI by cloning the package from GitHub and installing that way, however the following error message is returned:</p>
  
  <pre><code>[root@localhost Projects]# git clone https://github.com/asweigart/pyautogui
  Cloning into 'pyautogui'...
  remote: Counting objects: 1079, done.
  remote: Total 1079 (delta 0), reused 0 (delta 0), pack-reused 1079
  Receiving objects: 100% (1079/1079), 2.03 MiB | 697.00 KiB/s, done.
  Resolving deltas: 100% (733/733), done.
  [root@localhost Projects]# cd pyautogui
  [root@localhost pyautogui]# sudo python3 setup.py install
  Traceback (most recent call last):
    File "setup.py", line 6, in &lt;module&gt;
      version=__import__('pyautogui').__version__,
    File "/home/luke/Projects/pyautogui/pyautogui/__init__.py", line 115, in &lt;module&gt;
      from . import _pyautogui_x11 as platformModule
    File "/home/luke/Projects/pyautogui/pyautogui/_pyautogui_x11.py", line 160, in &lt;module&gt;
      _display = Display(os.environ['DISPLAY'])
    File "/usr/local/lib/python3.6/site-packages/Xlib/display.py", line 80, in __init__
      self.display = _BaseDisplay(display)
    File "/usr/local/lib/python3.6/site-packages/Xlib/display.py", line 62, in __init__
      display.Display.__init__(*(self, ) + args, **keys)
    File "/usr/local/lib/python3.6/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'No protocol specified\n'
  </code></pre>
  
  <p>I am following the instructions from Chapter 18 of Automate the Boring Stuff with the commands slightly altered to suit Fedora 27 Workstation.  </p>