No module named markupsafe

2,700 views
Skip to first unread message

Wawrzek Niewodniczanski

unread,
May 20, 2016, 9:09:20 AM5/20/16
to Ansible Project
Hi,

I just hit a problem with Ansible installed with pip. I cannot even get ansible version (see the bottom), but it is version 2.0.2.0 @ Ubuntu 14.04.4 LTS

pip list | grep ansible
ansible (2.0.2.0)


Installing markupsafe resolve the problem
sudo pip install markupsafe

Initial error message

ansible --version
ERROR! Unexpected Exception: No module named markupsafe
the full traceback was:

Traceback (most recent call last):
  File "/usr/local/bin/ansible", line 75, in <module>
    from ansible.cli.adhoc import AdHocCLI as mycli
  File "/usr/local/lib/python2.7/dist-packages/ansible/cli/adhoc.py", line 28, in <module>
    from ansible.executor.task_queue_manager import TaskQueueManager
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_queue_manager.py", line 28, in <module>
    from ansible.executor.play_iterator import PlayIterator
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/play_iterator.py", line 29, in <module>
    from ansible.playbook.block import Block
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/__init__.py", line 25, in <module>
    from ansible.playbook.play import Play
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/play.py", line 27, in <module>
    from ansible.playbook.base import Base
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/base.py", line 32, in <module>
    from jinja2.exceptions import UndefinedError
  File "/usr/local/lib/python2.7/dist-packages/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 13, in <module>
    from jinja2 import nodes
  File "/usr/local/lib/python2.7/dist-packages/jinja2/nodes.py", line 19, in <module>
    from jinja2.utils import Markup
  File "/usr/local/lib/python2.7/dist-packages/jinja2/utils.py", line 531, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: No module named markupsafe


Matt Martz

unread,
May 20, 2016, 9:17:14 AM5/20/16
to ansible...@googlegroups.com
Markupsafe is a dependency of jinja2 and not Ansible.  There must have been an issues with installing dependencies with pip that had gone unnoticed.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cf84e0a0-f3fd-44e5-bf68-0f93412c1546%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

João M. S. Silva

unread,
Dec 1, 2016, 6:23:43 PM12/1/16
to Ansible Project

Hi,


I got this error message:


  ERROR! Unexpected Exception: No module named markupsafe


after installing and running ansible.


I found out that the Python files for markupsafe where not in place: /usr/lib/python2.7/dist-packages/markupsafe did not exist.


I solved this with:


apt reinstall python-markupsafe


Reply all
Reply to author
Forward
0 new messages