Playbook error after Mint 22 upgrade

I recently upgraded from Mint 21.3 to Mint 22. Since the upgrade,my ansible setup is broken. I execute :
ansible-playbook -i hosts.yml update.yml --ask-vault-pass

The errors I see are:
Traceback (most recent call last):
File “/usr/bin/ansible-playbook”, line 62, in
import ansible.constants as C
File “/usr/lib/python3/dist-packages/ansible/constants.py”, line 12, in
from jinja2 import Template
File “/usr/lib/python3/dist-packages/jinja2/init.py”, line 33, in
from jinja2.environment import Environment, Template
File “/usr/lib/python3/dist-packages/jinja2/environment.py”, line 15, in
from jinja2 import nodes
File “/usr/lib/python3/dist-packages/jinja2/nodes.py”, line 23, in
from jinja2.utils import Markup
File “/usr/lib/python3/dist-packages/jinja2/utils.py”, line 656, in
from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name ‘soft_unicode’ from ‘markupsafe’ (/usr/lib/python3/dist-packages/markupsafe/init.py)

Any suggestions on how to fix this?

This is a python error, not an Ansible one. How was Ansible installed originally? Was it a deb/ppa/pip package? You will need to reinstall Ansible, but I can’t give you specific instructions without making any assumptions. I am also more of a fedora/rhel guy, so my debian is a little rusty. That said, I do have Ubuntu on a Surface Pro (long story), and I have to fiddle with third party repos whenever I do release upgrades. You may just need to re-enable the repository you installed Ansible from, and run updates.

1 Like