How do I Prevent Import Errors when Calling Python3 in Shell/Command Tasks when Python2 is the Discovered Interpreter for Ansible Engine?

Solution Verified - Updated -

Issue

When calling python3 through the shell, command, or raw module, python3 returns import errors.

Environment

Control Host: Ansible Engine
Managed Host: Python2.7 and Python3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content