Interview Prep/Python for DevOps/Automation scripting & CLI design

You must run the same Python automation on 40 servers that have Python 3.6, 3.9 and 3.12. What do you do?

IntermediateScenarioAutomation scripting & CLI design
Answer

Situation read → Python 3.6 is long end-of-life, and the modern boto3/requests versions no longer support it.

What I'd do →

  1. Do not depend on the system Python at all. Options: run the tool in a container, ship a self-contained venv built with the right version (uv python install 3.12 + venv), or use a single-file zipapp built with shiv/pex targeting a known interpreter.
  2. If agentless remote execution is the real need, use Ansible or SSM Run Command and keep the Python on the control side.
  3. Open a ticket to upgrade the 3.6 hosts; they are also missing security fixes.

Why → Writing to the lowest common denominator freezes you on dead versions and unsupported libraries.

Interview tip → Say "the OS Python belongs to the OS"; ship your own runtime.

All Python for DevOps questions Roadmap: Python for automation

More on Automation scripting & CLI design