Pyautogui konnte nicht gelesen werdenPython

Python-Programme
Anonymous
 Pyautogui konnte nicht gelesen werden

Post by Anonymous »

Es heißt, dass die von mir verwiesene Datei nicht existierte, obwohl sie sich im selben Verzeichnis befand. Ich verstehe nicht, was schief gelaufen ist. Hat es aufgehört, den neuesten Python zu unterstützen? < /P>

Code: Select all

import time
import pyautogui

print("started")

time.sleep(3)

#hello = pyautogui.locateCenterOnScreen('TEST.png')

pyautogui.click('hello.png')
< /code>
[ WARN:0@3.681] global /Users/xperience/actions-runner/_work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('hello.png'): can't open/read file: check file path/integrity
Traceback (most recent call last):
File "/Users/andrewzhuang/Programming/Python/Autogrinder/Autogrind Advanced.py", line 10, in 
pyautogui.click('hello.png')
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyautogui/__init__.py", line 598, in wrapper
returnVal = wrappedFunction(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyautogui/__init__.py", line 980, in click
x, y = _normalizeXYArgs(x, y)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyautogui/__init__.py", line 661, in _normalizeXYArgs
location = locateOnScreen(firstArg)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyautogui/__init__.py", line 175, in wrapper
return wrappedFunction(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyautogui/__init__.py", line 213, in locateOnScreen
return pyscreeze.locateOnScreen(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyscreeze/__init__.py", line 373, in locateOnScreen
retVal = locate(image, screenshotIm, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyscreeze/__init__.py", line 353, in locate
points = tuple(locateAll(needleImage, haystackImage, **kwargs))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyscreeze/__init__.py", line 207, in _locateAll_opencv
needleImage = _load_cv2(needleImage, grayscale)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyscreeze/__init__.py", line 170, in _load_cv2
raise IOError("Failed to read %s because file is missing, "
OSError: Failed to read hello.png because file is missing, has improper permissions, or is an unsupported or invalid format```

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post