Unable to install pyautogui on Linux: Attribute error
See original GitHub issueI am trying to install Pyautogui on Ubuntu using pip. I use python version 2.7.6. I have already installed xlib using apt-get install python-xlib
. When I try pip install pyautogui
, I run into the following error. Can someone please tell me what I could do about this.
Downloading/unpacking pyautogui
Downloading PyAutoGUI-0.9.36.tar.gz (46kB): 46kB downloaded
Running setup.py (path:/tmp/pip_build_phani/pyautogui/setup.py) egg_info for package pyautogui
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_phani/pyautogui/setup.py", line 6, in <module>
version=__import__('pyautogui').__version__,
File "pyautogui/__init__.py", line 115, in <module>
from . import _pyautogui_x11 as platformModule
File "pyautogui/_pyautogui_x11.py", line 160, in <module>
_display = Display(os.environ['DISPLAY'])
File "/usr/local/lib/python2.7/dist-packages/Xlib/display.py", line 127, in __init__
mod.init(self, info)
File "/usr/local/lib/python2.7/dist-packages/Xlib/ext/xinput.py", line 652, in init
disp.ge_add_event_data(info.major_opcode, device_event, DeviceEventData)
File "/usr/local/lib/python2.7/dist-packages/Xlib/display.py", line 227, in __getattr__
raise AttributeError(attr)
AttributeError: ge_add_event_data
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_phani/pyautogui/setup.py", line 6, in <module>
version=__import__('pyautogui').__version__,
File "pyautogui/__init__.py", line 115, in <module>
from . import _pyautogui_x11 as platformModule
File "pyautogui/_pyautogui_x11.py", line 160, in <module>
_display = Display(os.environ['DISPLAY'])
File "/usr/local/lib/python2.7/dist-packages/Xlib/display.py", line 127, in __init__
mod.init(self, info)
File "/usr/local/lib/python2.7/dist-packages/Xlib/ext/xinput.py", line 652, in init
disp.ge_add_event_data(info.major_opcode, device_event, DeviceEventData)
File "/usr/local/lib/python2.7/dist-packages/Xlib/display.py", line 227, in __getattr__
raise AttributeError(attr)
AttributeError: ge_add_event_data
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_phani/pyautogui
Storing debug log for failure in /home/phani/.pip/pip.log
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Unable to install PyAutoGui on Linux - Stack Overflow
I tried to install pyautogui on older python version, and have same error. I also tried to install all dependencies separately, and got...
Read more >ModuleNotFoundError: No module named 'pyautogui' in Python
To solve the error, install the module by running the pip install pyautogui command. no module named pyautogui. Open your terminal in your ......
Read more >20 controlling the keyboard and mouse with gui automation
When you run import pyautogui, Python will import your program instead of the PyAutoGUI and you'll get error messages like AttributeError: module 'pyautogui' ......
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 >pip3 install pyautogui fails with error code 1 Mac OS
Similar question · Install Xcode from AppStore · activate virtual environment (if needed) · pip3 install pyobjc-core · pip3 install pyobjc-framework-Quartz · pip3 ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is another issue in installation:
In setup.py there is import to pyautogui. It fails due installation order.
I have similar error: