Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible pypi missing markupsafe package as dependency #13570

Closed
tobias-urdin opened this issue Dec 16, 2015 · 11 comments
Closed

ansible pypi missing markupsafe package as dependency #13570

tobias-urdin opened this issue Dec 16, 2015 · 11 comments

Comments

@tobias-urdin
Copy link

When installing ansible using pip on a clean Ubuntu 14.04.2 LTS it's missing the markupsafe package as a dependency.

$ ansible-playbook --version
ansible-playbook 1.9.4

See below workflow, resolved with 'pip install markupsafe'.

$ apt-get install python-pip python-dev
$ pip install ansible
$ ansible-playbook 
Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 44, in <module>
    import ansible.playbook
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/__init__.py", line 20, in <module>
    import ansible.runner
  File "/usr/local/lib/python2.7/dist-packages/ansible/runner/__init__.py", line 32, in <module>
    import jinja2
  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

$ pip install markupsafe
$ ansible-playbook
Usage: ansible-playbook playbook.yml

...snip...

@bcoca
Copy link
Member

bcoca commented Dec 16, 2015

its a dependency of jinja2, ansible does not use it directly.

@tobias-urdin
Copy link
Author

Ok thanks for clarifying.

@nrser
Copy link

nrser commented May 5, 2016

um, so... jinja doesn't install a package it depends on? what's going on here? ran into the same issue

@nomasprime
Copy link

I'd like to know as well.

@geerlingguy
Copy link
Contributor

As a temporary workaround, you can run pip install markupsafe to install the package directly.

@bhasselbeck
Copy link

pip install markupsafe worked for me

@diarmaid-mcmanus
Copy link

diarmaid-mcmanus commented Jun 3, 2016

Installing markupsafe does make it work as said in the first report. I'm not sure why it's not included in requirements. I understand that it's not used directly, @bcoca, but without it ansible-playbook is being shipped broken.

Could markupsafe be added to requirements?

PS - happy to make the change if I can get some direction, or maybe this should be going upstream. I'm not too familiar with large project work :)

Should I be looking in this file, or elsewhere? https://github.com/ansible/ansible/blob/devel/lib/ansible/test-requirements.txt

@XCC007
Copy link

XCC007 commented Jul 21, 2016

小虫虫路过,学习了

@JulienPalard
Copy link
Contributor

Got this issue using pip 1.something, but did not get it after upgrading pip with python2.7 -m pip install --user --upgrade pip. With pip 8.1.2 it worked like charm.

Installed using: python2.7 -m pip install --user --no-use-wheel ansible

(I'm getting problems with CFFI when using wheels)

Hope ansible will soon be python3 compatible :)

@bcoca
Copy link
Member

bcoca commented Sep 26, 2016

To clarify, this is an issue with some broken versions of pip, Ansible correctly states that jinja2 is a requirement, the jinja2 package correctly states that markupsafe is a requirement.

Adding markupsafe would not fix the issue (broken pip) and would require us to add every possible sub dependency to our dependencies directly, keep track of all subprojects and their changes.

@geerlingguy
Copy link
Contributor

@bcoca Note that since it seems broken in pip in Ubuntu 14.04, users of the Linux Subsystem in Win10 will run into this (see: http://www.jeffgeerling.com/blog/2016/using-ansible-through-windows-10s-subsystem-linux).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants