“Failed to import the required Python library (botocore and boto3) on ANSIBLE_HOST’s Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter”
As you can see, I tried to set the right python interpreter on the relevant tasks, but it doesn’t seem to do much. It still can’t find boto3 (and botocore, which is installed as a dependency of boto3).
Can you link to a pastebin with the full results of the playbook? Run with -vvv or even -vvvv? I think one of those should show you the interpreter being used on the remote host, to triple-confirm the python path is correct.
Have you conformed manually that boto3 & botocore were actually installed to the python used by the user that ansible runs under, on the remote host?
Have you conformed manually that boto3 & botocore were actually installed to the python used by the user that ansible runs under, on the remote host?
boto3 & botocore were installed using the task I run prior to amazon.aws.s3_object. I didn’t use become: true so both tasks should run under the same user.
The last task was under a block (which I didn’t want to copy entirely because it was mostely irrelevant to the issue) which is executed with become: true. I am so ashamed it took me so long to realize that!