1. 安装
pip3 install cryptography==2.2.2 --install-option="--prefix=/home/tom/work"
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/c
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.6m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.6/c/_cffi_backend.o
c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-kiw038q0/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-z6qawl32-record/install-record.txt --single-version-externally-managed --compile --prefix=/home/tom/work --user --prefix=" failed with error code 1 in /tmp/pip-build-kiw038q0/cffi/
sudo apt-get install libffi-dev