Should be equal as integers keywords return rc as 1

When I use below code in a robot file (test.robot)

| | {results}= | Run Process | python3 | {CURDIR}/delete_from_db.py | shell=True
| | should be equal as integers | ${results.rc} | 0

and run this as a shell script as test.robot

#!/bin/bash
robot test.robot

Then I see error as “1 != 0” and it fails.
Note: Script (.py) file is fine and it runs successfully when executed from pycharm IDE (not as a shell script).
Pleas help

I believe ${results} contains output from the process (und thus your script). Check the documentation. I think it is ${results.stdout}. Then print the output in error case in your should keyword like this:

should be equal as integers 0 ${results.rc} ${results.stdout}

You should then see what the error is (probably that robot is missing in python that is installed in virtual environment of PyCharm)