ansible-playbook imports Python 2.7 jinja2

Bug #1907287 reported by Josh Zenker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ansible (Ubuntu)
New
Undecided
Unassigned

Bug Description

Description: Ubuntu 20.04.1 LTS
Release: 20.04

ansible:
  Installed: 2.9.6+dfsg-1
  Candidate: 2.9.6+dfsg-1
  Version table:
 *** 2.9.6+dfsg-1 500
        500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages
        100 /var/lib/dpkg/status

If you install the ansible package, it will install Python 3 as its dependencies. However, the ansible-playbook command imports the Python 2.7 jinja2 module and will fail with the following exception.

Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 67, in <module>
    import ansible.constants as C
  File "/usr/local/lib/python2.7/dist-packages/ansible/constants.py", line 11, in <module>
    from jinja2 import Template
ImportError: No module named jinja2

The workaround is to explicitly install the python-jinja2 package.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: ansible 2.9.6+dfsg-1
ProcVersionSignature: Ubuntu 5.4.0-56.62-generic 5.4.73
Uname: Linux 5.4.0-56-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.13
Architecture: amd64
CasperMD5CheckResult: skip
Date: Tue Dec 8 12:21:41 2020
PackageArchitecture: all
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ansible
UpgradeStatus: Upgraded to focal on 2020-11-30 (7 days ago)

Revision history for this message
Josh Zenker (jzenker) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.