fatal error: ffi.h: No such file or directory on pip2 install pyOpenSSL


One of the steps I always use to install / build my Ansible agent on target nodes was pip2 install pyOpenSSL. This is a requirement for your Ansible client in order to use the standard Ansible module for creating self signed certificates for example openssl_certificate

Since today this no longer works.

I can reproduce this message as follows:

The last step fails with message below. What is correct way to install pyOpenSSL on Ubuntu 18.04 at the moment? Is there a workaround for this problem?

Or beter, is there a Python distribution for Ansible? That includes all dependencies so I don’t have to compile build my own Ansible client?


Install libffi-dev to fix this issue.

Leave a Reply