question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to install pyautogui

See original GitHub issue

I have installed pillow, python3-xlib, python3-tk, python3-dev, scrot. Still not able to install pytautogui.

System details

→ uname -a
Linux pavilion 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

chillaranand@pavilion:~/projects |
→ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04 LTS
Release:        16.04
Codename:       xenial
chillaranand@pavilion:~/projects |
→ pip install pillow               
Requirement already satisfied (use --upgrade to upgrade): pillow in /home/chillaranand/.virtualenvs/exp/lib/python3.5/site-packages

chillaranand@pavilion:~/projects |
→ sudo apt-get install python3-xlib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-xlib is already the newest version (0.14+20091101-5).
0 upgraded, 0 newly installed, 0 to remove and 252 not upgraded.

chillaranand@pavilion:~/projects |
→ pip install pyautogui
Collecting pyautogui
  Using cached PyAutoGUI-0.9.33.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-rrn7mnyl/pyautogui/setup.py", line 6, in <module>
        version=__import__('pyautogui').__version__,
      File "/tmp/pip-build-rrn7mnyl/pyautogui/pyautogui/__init__.py", line 114, in <module>
        from . import _pyautogui_x11 as platformModule
      File "/tmp/pip-build-rrn7mnyl/pyautogui/pyautogui/_pyautogui_x11.py", line 6, in <module>
        from Xlib.display import Display
    ImportError: No module named 'Xlib'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-rrn7mnyl/pyautogui/

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
artburkartcommented, Aug 14, 2016

@ChillarAnand

I was able to get it to install in a virtualenv on xenial after some effort.

$ python --version
Python 2.7.12

$ virtualenv -p `which python` venv
Running virtualenv with interpreter /usr/bin/python
New python executable in /home/artburkart/Code/venv/bin/python
Installing setuptools, pip, wheel...done.

$ . venv/bin/activate

(venv) $ sudo apt install python-xlib python-tk
(venv) $ pip install Image
(venv) $ pip install python-xlib
(venv) $ pip install Image
(venv) $ pip install pyautogui

Only after installing these extra dependencies, could I get it to work.

12reactions
hugoesbcommented, Jul 29, 2016

You need pay attention about the Python you are installing and run: Python 2.x or Python 3.x. I guess your Ubuntu have Python 2.X and Python 3.X. If you want use pyautogui on Python 3.X install pillow and pyautogui using pip3.

$ pip3 install pillow $ pip3 install pyautogui

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot install PyAutoGUI - python - Stack Overflow
I tried installing PyAutoGUI-0.9.35 but the following came up when running cmd in the same folder: my input: pip install PyAutoGUI-0.9.35.
Read more >
ModuleNotFoundError: No module named 'pyautogui' in Python
The Python "ModuleNotFoundError: No module named 'pyautogui'" occurs when we forget to install the pyautogui module before importing it or ...
Read more >
Installation - PyAutoGUI documentation - Read the Docs
To install PyAutoGUI, install the pyautogui package from PyPI by running pip install pyautogui (on Windows) or pip3 install pyautogui (on macOS and...
Read more >
windows can't install PyAutoGui 0.9.41 · Issue #292 - GitHub
and i tried use pip install pyautogui===0.9.39 is working for me! 13
Read more >
I can't install pyautogui. Anyone know how to fix that problem?
Try running it (the pyautogui install) from an elevated administrator cmd. Upvote
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found