Having a hard time with ansible-vault encrypt

Getting a weird error when trying to run command to encrypt vault files with ansible-vault. I assume its a python thing but wondering if anyone has come across.

The is a brand new freshly installed project. Brand new macbook pro in fact. Running python 2.7.13, ansible, setuptools, pycrypt all installed and recent versions.



Some googling indicates this might just be a Python error as you anticipated. Check out this link which suggests forcing an upgrade to pip.

1 Like

Yeah that’s a weird error and hard to debug :frowning:

Is the content of that file still only:

# Documentation: https://roots.io/trellis/docs/vault/
vault_mail_password: smtp_password

If not, I’d try to make that file contain minimum yaml again, or maybe even empty. Just to rule anything out about the file itself.

yea thats all thats in the file, with an actual password, obv. Will try empty, thnx

yea have an even more recent version of setuptools 34.4.1 guess I could try going back.

I guess just for troubleshooting, does it encrypt the other vault.yml files ok? Is all/vault.yml the only problem file?

bit of a long shoot posting the question. Thnx anywayz!

happens with any of them

can someone give me a pip list?

curious what versions of ansible setuptools pyparse, pycrypt and… pip --version too maybe?

Python 2.7.13
pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)

ansible (
asn1crypto (0.22.0)
cffi (1.10.0)
cryptography (1.8.1)
enum34 (1.1.6)
idna (2.5)
ipaddress (1.0.18)
Jinja2 (2.9.6)
lxml (3.7.3)
MarkupSafe (1.0)
packaging (16.8)
paramiko (2.1.2)
pbr (2.0.0)
pip (9.0.1)
powerline-status (2.5.2)
psutil (5.2.1)
pyasn1 (0.2.3)
pycparser (2.17)
pycrypto (2.6.1)
pyparsing (2.2.0)
PyYAML (3.12)
readline (
setuptools (32.1.0)
six (1.10.0)
stevedore (1.21.0)
virtualenv (15.1.0)
virtualenv-clone (0.2.6)
virtualenvwrapper (4.7.2)
wheel (0.29.0)

There’s my pip list, as well as python and pip versions. No issues encrypting here, but I’m interested because, completely unrelated, I’ve been getting the same error with powerline and haven’t been able to figure it out yet.

1 Like

thnx so much, will try these versions and see how it goes

yup we have the same versions for all of those things. Assuming its asome sort of conflict between:


pycrypto (or whatever ansible uses for crypto)


in my case ansible version in your case powerline. It’s a nasty bugger tho. shakes fist

{also was just watching your videos last night, thnx for the awesome work!}

1 Like

Oh, hey, awesome - glad you enjoyed them!

I’m curious as to which Python you’re using? What do you get back if you run which python?

2.7.13 (which is supposed to have a fix to this problem according to SO)



i do have virtualenv installed but haven’t created a specific env for this project yet

Okay, exact same Python here.

Hey, try this -

pip list --outdated

This gave me 3 packages that were outdated (pdp, psutil, and setuptools, I think). Upgrading each package - pip install --upgrade foo - fixed my problem with Powerline.


thnx will give it a shot, I do see some outdated packages, setuptools being one of them.