I’m having a problem to find any kind of image, I was able to setup the city bot on two different environments but in both of them I get the same error, when trying to find an image, regardless the image. Follows the error below (using Python):
Traceback (most recent call last):
File “C:/Users/Lucas Camilote/PycharmProjects/checklisttotvs/bot/bot/bot.py”, line 59, in
Bot.main()
File “C:\Users\Lucas Camilote\AppData\Local\Programs\Python\Python38\lib\site-packages\botcity\base\bot.py”, line 142, in main
bot.action(execution)
File “C:/Users/Lucas Camilote/PycharmProjects/checklisttotvs/bot/bot/bot.py”, line 38, in action
if not self.find( “search”, matching=0.97, waiting_time=10000):
File “C:\Users\Lucas Camilote\AppData\Local\Programs\Python\Python38\lib\site-packages\botcity\core\bot.py”, line 275, in find_until
if is_retina():
File “C:\Users\Lucas Camilote\AppData\Local\Programs\Python\Python38\lib\site-packages\botcity\base\utils.py”, line 29, in is_retina
return retina
UnboundLocalError: local variable ‘retina’ referenced before assignment
I don’t know if I have to create a new post, but I’ve installed the bot Studio on a new environment, and this one has Python 3.9.13 installed, when I try to click on a image from this one, I get the following error:
Traceback (most recent call last):
File “C:\Users\Administrator\PycharmProjects\checklist\totvschecklist\totvschecklist\bot.py”, line 38, in
Bot.main()
File “C:\Users\Administrator\PycharmProjects\checklist\venv\lib\site-packages\botcity\base\bot.py”, line 142, in main
bot.action(execution)
File “C:\Users\Administrator\PycharmProjects\checklist\totvschecklist\totvschecklist\bot.py”, line 25, in action
if not self.find( “oamp”, matching=0.97, waiting_time=10000):
File “C:\Users\Administrator\PycharmProjects\checklist\venv\lib\site-packages\botcity\core\bot.py”, line 272, in find_until
ele = pyautogui.locateOnScreen(element_path, region=region, confidence=matching,
File “C:\Users\Administrator\PycharmProjects\checklist\venv\lib\site-packages\pyautogui_init_.py”, line 175, in wrapper
return wrappedFunction(*args, **kwargs)
File “C:\Users\Administrator\PycharmProjects\checklist\venv\lib\site-packages\pyautogui_init_.py”, line 213, in locateOnScreen
return pyscreeze.locateOnScreen(*args, **kwargs)
File “C:\Users\Administrator\PycharmProjects\checklist\venv\lib\site-packages\pyscreeze_init_.py”, line 372, in locateOnScreen
retVal = locate(image, screenshotIm, **kwargs)
File “C:\Users\Administrator\PycharmProjects\checklist\venv\lib\site-packages\pyscreeze_init_.py”, line 352, in locate
points = tuple(locateAll(needleImage, haystackImage, **kwargs))
File “C:\Users\Administrator\PycharmProjects\checklist\venv\lib\site-packages\pyscreeze_init_.py”, line 252, in _locateAll_python
raise NotImplementedError(‘The confidence keyword argument is only available if OpenCV is installed.’)
NotImplementedError: The confidence keyword argument is only available if OpenCV is installed.
Would you be able to take a look on this one? Please
I noticed that, and already tried to install the package, but I receive the message “Requirement already satisfied” and when I try to find an image I get the same error anyway.
I have installed the same Python version (3.10.4) as I have installed in another environment (and it works) and now I’m receiving the following error:
Traceback (most recent call last):
File “C:\Users\Administrator\PycharmProjects\checklist2\dailychecklist\dailychecklist\bot.py”, line 23, in
from botcity.core import DesktopBot
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botcity\core_init_.py”, line 1, in
from .bot import * # noqa: F401, F403
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botcity\core\bot.py”, line 16, in
from . import config, cv2find, os_compat
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botcity\core\cv2find.py”, line 34, in
import cv2
ImportError: DLL load failed while importing cv2: The specified module could not be found.
I was doing some research and it seems to be a problem that can be caused by many different reasons. Could you downgrade the installed version of open-cv just to test if the behavior is the same?
I found a solution for my environment, the issue (apparently) was running the bot Studio on Windows Server 2012 R2, so I had to install a feature (Desktop Experience) on my Windows Server and it worked, follow the link I used as a reference: