-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Cannot import pyautogui due to pygetwindow not supporting linux #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@jfmoulin it looks like the recent work on The solution I found is to use the PyPi snapshot/release [:~/projects] $ mkd pyautogui_linux_09_39 [:~/projects/pyautogui_linux_09_39] $ pipenv shell [:~/projects/pyautogui_linux_09_39] $ . .local/share/virtualenvs/pyautogui_linux_09_39-6lzKIWuD/bin/activate [:~/projects/pyautogui_linux_09_39] [pyautogui_linux_09_39-6lzKIWuD] $ pipenv install pyautogui==0.9.39 [:~/projects/pyautogui_linux_09_39] [pyautogui_linux_09_39-6lzKIWuD] $ pipenv install xlib [:~/projects/pyautogui_linux_09_39] [pyautogui_linux_09_39-6lzKIWuD] $ cat ./pyautogui_linux_09_39_example.py #!/usr/bin/env python3
import pyautogui
# watch -n1 "python pyautogui_linux_09_39.py"
# to get the coordinates of the target window
#currentMouseX, currentMouseY = pyautogui.position()
#print(currentMouseX, currentMouseY)
pyautogui.moveTo(746, 588) # go to VIM window
pyautogui.click()
pyautogui.press('i') #activate INSERT mode in VIM
pyautogui.PAUSE = 0.50
pyautogui.typewrite('Hello world!', interval=0.25) # type with quarter-second pause in between each key
pyautogui.press('esc')
pyautogui.press(['d', 'd']) # delete the current line
# and replace it with a penguin emoji; Unicode U+1F427 🐧
pyautogui.press('i')
pyautogui.hotkey('ctrl', 'shift', 'u')
pyautogui.press(['1', 'f', '4', '2', '7'])
pyautogui.press('enter')
pyautogui.press('esc') [:~/projects/pyautogui_linux_09_39] [pyautogui_linux_09_39-6lzKIWuD] $ python ./pyautogui_linux_09_39_example.py |
This works for me as well. Chaning to version 0.9.39. What are ongoing plans for this fix? Will the main branch support linux without any additional work? |
Just installed pyautogui 0.9.40 via pip3 under Linux Mint 19.1.
I cannot import the module due to pygetwindow not being supported on Linux.
Code seen in init.py suggests that some methods should be missing but the NotImplementedError of pygetwindow is not properly caught.
Trace of an Ipython session where I got the problem:
NotImplementedError: PyGetWindow currently does not support Linux. If you have Xlib knowledge, please contribute! https://github.com/asweigart/pygetwindow
`
The text was updated successfully, but these errors were encountered: