Getting AttributeError: module 'pyscreeze' has no attribute 'locateOnWindow' on import
See original GitHub issueWhen attempting import pyautogui
, I get the following error message and traceback:
Traceback (most recent call last):
File "<ipython-input-1-fa2587ca3a04>", line 1, in <module>
import pyautogui
File "/usr/lib/python3.9/site-packages/pyautogui/__init__.py", line 221, in <module>
locateOnWindow.__doc__ = pyscreeze.locateOnWindow.__doc__
AttributeError: module 'pyscreeze' has no attribute 'locateOnWindow'
I have checked the contents of pyscreeze/__init__.py
, not just on my computer, but as it currently appears in the pyscreeze repository as well, and there really is no locateOnWindow
function/class/etc. contained in it.
The problem might have been introduced by this commit about 2-3 months ago. Strangely, however, I have not been able to find anyone else on the web experiencing it.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Am using the pyautogui module now from Automate the ...
Am using the pyautogui module now from Automate the Boring Stuff With Python. My code keeps telling me pyscreeze has no attribute locateOnWindow....
Read more >Error when importing PyAutoGUI : r/learnpython - Reddit
When I run import pyautogui I get this error: AttributeError: module 'pyscreeze' has no attribute 'locateOnWindow'
Read more >PyScreeze - PyPI
PyScreeze is a simple, cross-platform screenshot module for Python 2 and 3. About. PyScreeze can take screenshots, save them to files, and locate...
Read more >A brand new website interface for an even better experience!
Getting AttributeError : module 'pyscreeze' has no attribute 'locateOnWindow' on import.
Read more >module 'pyscreeze' has no attribute 'locateOnWindow'
pyautogui AttributeError: module 'pyscreeze' has no attribute ... When attempting import pyautogui, I get the following error message and ...
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
Hi Everyone! I hope everyone is doing well. It looks like there is an easy fix for this one.
https://github.com/asweigart/pyautogui/blob/5e4acb870f2e7ce0ea1927cc5188bc2f5ab7bbbc/pyautogui/__init__.py#L221
Here on this line we just need to change
To This:
Update this and your inputs will work. The
locateOnWindow
changed tolocateOnScreen
.++@asweigart, FYI
The file location for me was: ‘C:\Users\
{UserName}
\AppData\Roaming\Python\Python39\site-packages\pyautogui\init.py’Do not look in the
C:\Program Files\Python39
foldersYou should update pyscreeze to at least 0.1.28. to fix this error.
pip3 install pyscreeze -U