Image recognition doesn't work

I’m trying to use image to click on a button. But I keep getting a rpaframework-recognition package not installed error. I’m using python.

Yes I have already pip installed the package.

image

I’m just trying to do something really simple like:

from RPA.Desktop import Desktop
dt = Desktop()
dt.open_application(r"C:\Windows\System32\notepad.exe")
dt.click(“image:one.png”)

any idea what’s wrong?

I solved the problem by creating another virtual environment and did a fresh pip installation of rpaframework and rpaframework[cv]. There must be some conflict in my previous environment but I don’t know what that was.

Good to hear that you got it solved :+1:

If you want to try Robocorp’s environment management, you can define robot.yaml and conda.yaml in your robot directory and then run the robot with rcc command-line-tool. That would handle the environment setup automatically and in a repeatable way. Robot structure & configuration

Initially, I had an older version of rpaframework installed v12.8.2.

When I pip installed the rpaframework-recognition, the original rpaframework wasn’t updated automatically. I suspect there are some compatibility problem between the different versions of the two libraries.

So I did a fresh re-installation of both libraries with a brand new environment. That solved the problem.