title: fatal error: ffi.h: No such file or directory on pip2 install pyOpenSSL
body: <p>One of the steps I always use to install / build my Ansible agent on target nodes was <code>pip2 install pyOpenSSL</code>. This is a requirement for your Ansible client in order to use the standard Ansible module for creating self signed certificates for example <code>openssl_certificate</code></p>
  
  <p>Since today this no longer works.</p>
  
  <p>I can reproduce this message as follows:</p>
  
  <pre><code>vagrant init generic/ubuntu1804
  vagrant ssh
  sudo su -
  apt-get update &amp;&amp; apt-get -y install python python-pip
  pip2 install pyOpenSSL
  </code></pre>
  
  <p>The last step fails with message below. What is correct way to install <strong>pyOpenSSL</strong> on Ubuntu 18.04 at the moment? Is there a workaround for this problem?</p>
  
  <p>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?</p>
  
  <pre><code>root@ubuntu1804:~# pip2 install pyOpenSSL
  Collecting pyOpenSSL
    Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('&lt;urllib3.connection.VerifiedHTTPSConnection object at 0x7fc72409d5d0&gt;: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl
    Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('&lt;urllib3.connection.VerifiedHTTPSConnection object at 0x7fc72409d750&gt;: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl
    Downloading https://files.pythonhosted.org/packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl (53kB)
      100% |################################| 61kB 1.0MB/s 
  Collecting cryptography&gt;=2.3 (from pyOpenSSL)
    Downloading https://files.pythonhosted.org/packages/e6/68/50698ce24c61db7d44d93a5043c621a0ca7839d4ef9dff913e6ab465fc92/cryptography-2.7-cp27-cp27mu-manylinux1_x86_64.whl (2.3MB)
      100% |################################| 2.3MB 427kB/s 
  Requirement already satisfied: six&gt;=1.5.2 in /usr/lib/python2.7/dist-packages (from pyOpenSSL)
  Requirement already satisfied: asn1crypto&gt;=0.21.0 in /usr/lib/python2.7/dist-packages (from cryptography&gt;=2.3-&gt;pyOpenSSL)
  Requirement already satisfied: enum34; python_version &lt; "3" in /usr/lib/python2.7/dist-packages (from cryptography&gt;=2.3-&gt;pyOpenSSL)
  Requirement already satisfied: ipaddress; python_version &lt; "3" in /usr/lib/python2.7/dist-packages (from cryptography&gt;=2.3-&gt;pyOpenSSL)
  Collecting cffi!=1.11.3,&gt;=1.8 (from cryptography&gt;=2.3-&gt;pyOpenSSL)
    Downloading https://files.pythonhosted.org/packages/d6/cf/ba7e2df852a2fc807d48b3f7bea46f741830be4f047a0712e6de3e95fb6a/cffi-1.13.0.tar.gz (459kB)
      100% |################################| 460kB 299kB/s 
  Collecting pycparser (from cffi!=1.11.3,&gt;=1.8-&gt;cryptography&gt;=2.3-&gt;pyOpenSSL)
    Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
      100% |################################| 163kB 280kB/s 
  Building wheels for collected packages: cffi, pycparser
    Running setup.py bdist_wheel for cffi ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-YCu4xd/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp_m8aI7pip-wheel- --python-tag cp27:
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/cffi
    copying cffi/verifier.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/vengine_cpy.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/__init__.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/model.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/pkgconfig.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/cparser.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/api.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/backend_ctypes.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/ffiplatform.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/lock.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/cffi_opcode.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/error.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/commontypes.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/setuptools_ext.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/vengine_gen.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/recompiler.py -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/_cffi_include.h -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/parse_c_type.h -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/_embedding.h -&gt; build/lib.linux-x86_64-2.7/cffi
    copying cffi/_cffi_errors.h -&gt; build/lib.linux-x86_64-2.7/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/c
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-PPrPZj/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
    c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
     #include &lt;ffi.h&gt;
              ^~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
    ----------------------------------------
    Failed building wheel for cffi
    Running setup.py clean for cffi
    Running setup.py bdist_wheel for pycparser ... done
    Stored in directory: /root/.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511
  Successfully built pycparser
  Failed to build cffi
  Installing collected packages: pycparser, cffi, cryptography, pyOpenSSL
    Running setup.py install for cffi ... error
      Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-YCu4xd/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-FxUNAq-record/install-record.txt --single-version-externally-managed --compile:
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-2.7
      creating build/lib.linux-x86_64-2.7/cffi
      copying cffi/verifier.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/vengine_cpy.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/__init__.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/model.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/pkgconfig.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/cparser.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/api.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/backend_ctypes.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/ffiplatform.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/lock.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/cffi_opcode.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/error.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/commontypes.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/setuptools_ext.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/vengine_gen.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/recompiler.py -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/_cffi_include.h -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/parse_c_type.h -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/_embedding.h -&gt; build/lib.linux-x86_64-2.7/cffi
      copying cffi/_cffi_errors.h -&gt; build/lib.linux-x86_64-2.7/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-x86_64-2.7
      creating build/temp.linux-x86_64-2.7/c
      x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-PPrPZj/python2.7-2.7.15=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
       #include &lt;ffi.h&gt;
                ^~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
      ----------------------------------------
  Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-YCu4xd/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-FxUNAq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-YCu4xd/cffi/
  root@ubuntu1804:~# 
  </code></pre>