Execute Shell Script / Task - Error when importing python module psycopg2 - «ModuleNotFoundError: No module named 'psycopg2._psycopg'»

Have you tried like in the other thread you referenced? So instead of using /bin/bash -c directly using python?