psycog2 is installed but postgresql_user gives error that psycog2 is required

psycog2 has beeen installed using ansible pip module.

The postgresql_user module fails with a message saying psycog2 is required.

pip list shows that psycog2 is installed on the managed system.
ansible 2.4.3, python 2.7.10
managed system is rhel 7.4

Have I missed something ?

I found that with /usr/bin/python I cannot import psycopg2, but with /usr/local/bin/python I can. Guess there’s two python envs on my managed host.

solved by setting
ansible_python_interpreter: /usr/local/bin/python