ansible-playbook imports Python 2.7 jinja2
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://
500 http://
100 /var/lib/
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/
import ansible.constants as C
File "/usr/local/
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
ProcVersionSign
Uname: Linux 5.4.0-56-generic x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Tue Dec 8 12:21:41 2020
PackageArchitec
ProcEnviron:
TERM=screen
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ansible
UpgradeStatus: Upgraded to focal on 2020-11-30 (7 days ago)