Unable to install ansible 2.0.0.2 via pip

Has anyone seen this when trying to install ansible via pip on ubuntu?

Running setup.py install for cryptography

c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory

#include <ffi.h>

^

compilation terminated.

Traceback (most recent call last):

File “”, line 1, in

File “/tmp/pip_build_root/cryptography/setup.py”, line 335, in

**keywords_with_side_effects(sys.argv)

File “/usr/lib/python2.7/distutils/core.py”, line 111, in setup

_setup_distribution = dist = klass(attrs)

File “/usr/lib/python2.7/dist-packages/setuptools/dist.py”, line 239, in init

self.fetch_build_eggs(attrs.pop(‘setup_requires’))

File “/usr/lib/python2.7/dist-packages/setuptools/dist.py”, line 264, in fetch_build_eggs

replace_conflicting=True

File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 620, in resolve

dist = best[req.key] = env.best_match(req, ws, installer)

File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 858, in best_match

return self.obtain(req, installer) # try and download/install

File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 870, in obtain

return installer(requirement)

File “/usr/lib/python2.7/dist-packages/setuptools/dist.py”, line 314, in fetch_build_egg

return cmd.easy_install(req)

File “/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py”, line 616, in easy_install

return self.install_item(spec, dist.location, tmpdir, deps)

File “/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py”, line 646, in install_item

dists = self.install_eggs(spec, download, tmpdir)

File “/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py”, line 834, in install_eggs

return self.build_and_install(setup_script, setup_base)

File “/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py”, line 1040, in build_and_install

self.run_setup(setup_script, setup_base, args)

File “/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py”, line 1028, in run_setup

raise DistutilsError(“Setup script exited with %s” % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

Complete output from command /usr/bin/python -c “import setuptools, tokenize;file=‘/tmp/pip_build_root/cryptography/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(‘\r\n’, ‘\n’), file, ‘exec’))” install --record /tmp/pip-HFaoc7-record/install-record.txt --single-version-externally-managed --compile:

c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory

Had to install libffi-dev and libssl-dev to get around this. Then setuptool >v11.3 first, then finally ansible worked.

Something seem to have changed in the last two days, pip dependencies?

paramiko 2.0 changed their dependency from pycrypto to cryptography. cryptography has a dependency on cffi, which requires libffi-dev.

Looks like paramiko 2.0 was released on 2016-04-29

Eh, would nice if pip transitive dependencies were version locked. Any idea if it would cause this → https://groups.google.com/forum/#!topic/ansible-project/_m3WUcBYmZY ?

Thank you for pointing this out! I have been unable to build any systems for weeks now, and have been banging my head against the wall as to what has changed!
Updating my installation to use:
pip install paramiko==1.17.0 ansible==2.0.0

and problem solved!
Successfully installed paramiko ansible pycrypto ecdsa jinja2 PyYAML MarkupSafe

What’s 2.0.0?

We just ended up installing libffi-dev, lifbssl-dev then

pip install setuptools=11.3 ansible==2.0.0.2.

It’s annoying that if a dependency changes it will affect what you’re trying to install.