#๐Ÿ”’ why is this not detecting the image with pyautogui

38 messages ยท Page 1 of 1 (latest)

regal dragonBOT
#

@woven ginkgo

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

ancient stirrup
woven ginkgo
woven ginkgo
#

i sent coz its easier

opal inlet
#

Both the code and image can be posted here directly fairly trivially.

#

The code as text, and the image just as an image.

woven ginkgo
regal dragonBOT
ancient stirrup
#

@woven ginkgo pithink

woven ginkgo
#

but why its not detecting

#

its straight there in the picture

ancient stirrup
regal dragonBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

woven ginkgo
remote cairn
#

It's not like it's an effort to cheat in chess.

woven ginkgo
#

but can u all tell me the error ๐Ÿ˜ญ

remote cairn
#

What's your issue?

#

More importantly, why do you want to do chess with image rec?

woven ginkgo
#

Traceback (most recent call last):
File "c:\Users\username.user\Desktop\Chess automator\this one.py", line 16, in <module>
pg.locate("black_pawn.png", "screenshot.png")
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\username.user\AppData\Roaming\Python\Python313\site-packages\pyautogui_init_.py", line 174, in wrapper
raise ImageNotFoundException # Raise PyAutoGUI's ImageNotFoundException.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pyautogui.ImageNotFoundException

remote cairn
#

That's so much resource for sth that doesn't need it.

remote cairn
woven ginkgo
#

whts right?

remote cairn
#

I can't see your pc man. You have to check the path of the images, and input it there correctly.

woven ginkgo
#

lol see screenshot is in same folder as the .py and pawn.png in /pieces

remote cairn
woven ginkgo
remote cairn
#

Give me a sec. I'll try it on my side in a bit.

woven ginkgo
#

ty

woven ginkgo
#

lol it got solved actually i took more precise crop and it detected

regal dragonBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.