import pyautogui
wh = pyautogui.size()
print(wh)
output:
locateOnWindow.__doc__ = pyscreeze.locateOnWindow.__doc__
AttributeError: module 'pyscreeze' has no attribute 'locateOnWindow'
Please I will be grateful for your Help.
import pyautogui
wh = pyautogui.size()
print(wh)
output:
locateOnWindow.__doc__ = pyscreeze.locateOnWindow.__doc__
AttributeError: module 'pyscreeze' has no attribute 'locateOnWindow'
Please I will be grateful for your Help.
locatOnWindows method is missing from pyscreeze init.py file, you can get the updated code from link below, just copy and past the code to pyscreeze init.py file and hopefully this issue will be resolved
https://github.com/asweigart/pyscreeze/blob/master/pyscreeze/init.py#L418
I deleted pyautogui and pyscreeze, then it worked for me.
To delete First locate where pyautogui is installed. Use this command to locate pyautogui on your machine:
pip show pyautogui
Then copy location.
My location was:
c:\users\nitro 5\appdata\local\programs\python\python38\lib\site-packages
Delete Pyautogui and pyscreeze.
Install pyautogui:
pip install pyautogui
try to change init.py in C:\Users\User\AppData\Local\Programs\Python\Python310\Lib\site-packages\pyscreeze from github: https://github.com/asweigart/pyscreeze/blob/master/pyscreeze/__init__.py
I have also had the exact same issue. All that I really had to do was to install the newer version of the Pyscreeze library. As you can see from this link https://github.com/asweigart/pyscreeze/commit/9edb5d70fbe3b3ee2f2cb710f25401b893d51dfc they've added the locateOnWindow() function in the version of 0.1.27. As for my part, I'd had the Pyscreeze of 0.1.26 version. After I'd had installed the newer version of the library everything started working just fine.
I had the same problem and solved it with this method
pip install --upgrade pyscreeze