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

ImportError: No module named markup safe #6

Closed
davestacey opened this Issue Jul 10, 2013 · 14 comments

Comments

Projects
None yet
@davestacey
Copy link

davestacey commented Jul 10, 2013

I am close but stuck on:
"ImportError: No module named markup safe"
I tried to workaround manually by vagrant ssh and sudo easy_install jinja2 but no luck. - Thanks!

vagrant provision
[default] Running provisioner: ansible...
Traceback (most recent call last):
File "/Users/webdev/Applications/ansible/bin/ansible-playbook", line 24, in
import ansible.playbook
File "/Users/webdev/Applications/ansible/lib/ansible/playbook/init.py", line 18, in
import ansible.inventory
File "/Users/webdev/Applications/ansible/lib/ansible/inventory/init.py", line 27, in
from ansible.inventory.script import InventoryScript
File "/Users/webdev/Applications/ansible/lib/ansible/inventory/script.py", line 25, in
from ansible import utils
File "/Users/webdev/Applications/ansible/lib/ansible/utils/init.py", line 29, in
from ansible.utils import template
File "/Users/webdev/Applications/ansible/lib/ansible/utils/template.py", line 21, in
import jinja2
File "/Library/Python/2.7/site-packages/jinja2/init.py", line 33, in
from jinja2.environment import Environment, Template
File "/Library/Python/2.7/site-packages/jinja2/environment.py", line 13, in
from jinja2 import nodes
File "/Library/Python/2.7/site-packages/jinja2/nodes.py", line 18, in
from jinja2.utils import Markup
File "/Library/Python/2.7/site-packages/jinja2/utils.py", line 520, in
from markupsafe import Markup, escape, soft_unicode
[error] ImportError: No module named markup safe

@rdickert

This comment has been minimized.

Copy link
Owner

rdickert commented Jul 11, 2013

It does look like you are close. After digging around, it looks like Jinja has added a new dependency on the MarkupSafe package since I installed it (I'm on version 2.6 - you can check your version by typing pip freeze in your terminal - at least for pip packages). Try running sudo pip install markupsafe or sudo easy_install markupsafe.

Side note: From what you said, it looks like you ran sudo easy_install jinja2 on your vagrant-provisioned vm (after vagrant ssh). Any Ansible dependencies will need to be installed on your root machine - the one running Ansible - not the provisioning target (there will be no effect there, and anything you need on the target machine should be installed by Ansible).

Let me know if this works. If it does, I'll plan to update the docs. Thanks for trying out Project Quicksilver!

@davidopluslau

This comment has been minimized.

Copy link

davidopluslau commented Mar 14, 2014

Maybe it didn't help him/her, but it did help me. Thanks! :D

@rdickert

This comment has been minimized.

Copy link
Owner

rdickert commented Mar 14, 2014

Glad it helped!

@vivekraunak

This comment has been minimized.

Copy link

vivekraunak commented Dec 25, 2014

Hi
i have downloaded jinja2 from https://pypi.python.org/pypi/Jinja2
and put it in C:\Python27 location.
i am getting import error

from jinja2 import Environment, FileSystemLoader
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\jinja2__init__.py", line 33, in
from jinja2.environment import Environment, Template
File "C:\Python27\jinja2\environment.py", line 13, in
from jinja2 import nodes
File "C:\Python27\jinja2\nodes.py", line 18, in
from jinja2.utils import Markup
File "C:\Python27\jinja2\utils.py", line 520, in
from markupsafe import Markup, escape, soft_unicode
ImportError: No module named markupsafe

could you please suggest what should i do to get markupsafe module.

@vivekraunak

This comment has been minimized.

Copy link

vivekraunak commented Dec 25, 2014

so it was very simple
i downloaded markupsafe from https://pypi.python.org/pypi/MarkupSafe and put it in https://pypi.python.org/pypi/Jinja2
and it worked!! :-)

@f31n

This comment has been minimized.

Copy link

f31n commented Oct 28, 2015

helped me as well...
"pip install markupsafe"

@jussiheinonen

This comment has been minimized.

Copy link

jussiheinonen commented Nov 11, 2015

'pip install markupsafe' did the job for me as well

@geerlingguy

This comment has been minimized.

Copy link

geerlingguy commented Mar 8, 2016

Same here, for some reason; I only ran into this after I had attempted to install ansible on a fresh Debian 8 VM and had forgotten to install build-essential prior to pip install ansible. The install failed during pycrypto install, and I ran into this error even after uninstalling and reinstalling Ansible.

@ejhw

This comment has been minimized.

Copy link

ejhw commented Mar 29, 2016

'pip install markupsafe' did not work for me. I had to download the markupsafe tarball and do sudo python setup.py install to install it.

@thechristian

This comment has been minimized.

Copy link

thechristian commented Apr 25, 2016

"sudo pip install markupsafe" worked for me

@ratnamaddha

This comment has been minimized.

Copy link

ratnamaddha commented Jan 25, 2017

The Markupsafe Version on your flask framework (pip freeze) and the version in requirements.txt should be the same.

@cell13

This comment has been minimized.

Copy link

cell13 commented Sep 22, 2017

@ ejhw I solved the problem as your way. Thank you very much.

@bulught

This comment has been minimized.

Copy link

bulught commented Dec 4, 2017

It surely did help me, Thanks!

@Lucantas

This comment has been minimized.

Copy link

Lucantas commented Jan 11, 2018

I've tried rdickert's solution, with no success. But downloading the markupsafe tar ball did, thank you ejhw for the tip

@davestacey davestacey closed this Mar 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment