Installation fails on Debian 10

I am using Debian 10 and having some issues with Python/PIP.

I’ve managed to somehow stumble my way up to this point, after somehow finally installing virtualenv: pip install privacyidea

However, it fails to install the crypto dependencies, and I can’t proceed from here. This is the exact error at the end:

Building wheels for collected packages: cryptography, argon2-cffi, bcrypt
  Building wheel for cryptography (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/privacyidea/bin/python /opt/privacyidea/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp3UGnen
       cwd: /tmp/pip-install-vbH8ar/cryptography
  Complete output (134 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-i686-2.7
  creating build/lib.linux-i686-2.7/cryptography
  copying src/cryptography/fernet.py -> build/lib.linux-i686-2.7/cryptography
  copying src/cryptography/utils.py -> build/lib.linux-i686-2.7/cryptography
  copying src/cryptography/__about__.py -> build/lib.linux-i686-2.7/cryptography
  copying src/cryptography/__init__.py -> build/lib.linux-i686-2.7/cryptography
  copying src/cryptography/exceptions.py -> build/lib.linux-i686-2.7/cryptography
  creating build/lib.linux-i686-2.7/cryptography/x509
  copying src/cryptography/x509/oid.py -> build/lib.linux-i686-2.7/cryptography/x509
  copying src/cryptography/x509/__init__.py -> build/lib.linux-i686-2.7/cryptography/x509
  copying src/cryptography/x509/ocsp.py -> build/lib.linux-i686-2.7/cryptography/x509
  copying src/cryptography/x509/base.py -> build/lib.linux-i686-2.7/cryptography/x509
  copying src/cryptography/x509/name.py -> build/lib.linux-i686-2.7/cryptography/x509
  copying src/cryptography/x509/general_name.py -> build/lib.linux-i686-2.7/cryptography/x509
  copying src/cryptography/x509/certificate_transparency.py -> build/lib.linux-i686-2.7/cryptography/x509
  copying src/cryptography/x509/extensions.py -> build/lib.linux-i686-2.7/cryptography/x509
  creating build/lib.linux-i686-2.7/cryptography/hazmat
  copying src/cryptography/hazmat/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat
  copying src/cryptography/hazmat/_der.py -> build/lib.linux-i686-2.7/cryptography/hazmat
  copying src/cryptography/hazmat/_oid.py -> build/lib.linux-i686-2.7/cryptography/hazmat
  creating build/lib.linux-i686-2.7/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends
  creating build/lib.linux-i686-2.7/cryptography/hazmat/bindings
  copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings
  creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives
  creating build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed25519.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/poly1305.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed448.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x448.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ocsp.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x25519.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl
  creating build/lib.linux-i686-2.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings/openssl
  creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf
  creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric
  creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor
  creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/pkcs7.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/base.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/serialization
  creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers
  running egg_info
  writing requirements to src/cryptography.egg-info/requires.txt
  writing src/cryptography.egg-info/PKG-INFO
  writing top-level names to src/cryptography.egg-info/top_level.txt
  writing dependency_links to src/cryptography.egg-info/dependency_links.txt
  reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/_build'
  warning: no previously-included files found matching 'vectors'
  warning: no previously-included files matching '*' found under directory 'vectors'
  warning: no previously-included files found matching '.travis.yml'
  warning: no previously-included files found matching '.travis'
  warning: no previously-included files matching '*' found under directory '.travis'
  warning: no previously-included files matching '*' found under directory '.github'
  warning: no previously-included files found matching 'release.py'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files found matching 'dev-requirements.txt'
  warning: no previously-included files found matching 'rtd-requirements.txt'
  warning: no previously-included files found matching 'tox.ini'
  warning: no previously-included files matching '*' found under directory '.zuul.d'
  warning: no previously-included files matching '*' found under directory '.zuul.playbooks'
  writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
  running build_ext
  generating cffi module 'build/temp.linux-i686-2.7/_padding.c'
  creating build/temp.linux-i686-2.7
  generating cffi module 'build/temp.linux-i686-2.7/_openssl.c'
  building '_openssl' extension
  creating build/temp.linux-i686-2.7/build
  creating build/temp.linux-i686-2.7/build/temp.linux-i686-2.7
  i686-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-EBAgX8/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-i686-2.7/_openssl.c -o build/temp.linux-i686-2.7/build/temp.linux-i686-2.7/_openssl.o -Wconversion -Wno-error=sign-conversion
  unable to execute 'i686-linux-gnu-gcc': No such file or directory
  error: command 'i686-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for cryptography
  Building wheel for argon2-cffi (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/privacyidea/bin/python /opt/privacyidea/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpWRnaNa
       cwd: /tmp/pip-install-vbH8ar/argon2-cffi
  Complete output (24 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-i686-2.7
  creating build/lib.linux-i686-2.7/argon2
  copying src/argon2/__init__.py -> build/lib.linux-i686-2.7/argon2
  copying src/argon2/__main__.py -> build/lib.linux-i686-2.7/argon2
  copying src/argon2/_password_hasher.py -> build/lib.linux-i686-2.7/argon2
  copying src/argon2/_legacy.py -> build/lib.linux-i686-2.7/argon2
  copying src/argon2/exceptions.py -> build/lib.linux-i686-2.7/argon2
  copying src/argon2/_utils.py -> build/lib.linux-i686-2.7/argon2
  copying src/argon2/low_level.py -> build/lib.linux-i686-2.7/argon2
  copying src/argon2/_ffi_build.py -> build/lib.linux-i686-2.7/argon2
  running build_clib
  building 'argon2' library
  creating build/temp.linux-i686-2.7
  creating build/temp.linux-i686-2.7/extras
  creating build/temp.linux-i686-2.7/extras/libargon2
  creating build/temp.linux-i686-2.7/extras/libargon2/src
  creating build/temp.linux-i686-2.7/extras/libargon2/src/blake2
  i686-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-EBAgX8/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -msse2 -Iextras/libargon2/src/../include -Iextras/libargon2/src/blake2 -c extras/libargon2/src/argon2.c -o build/temp.linux-i686-2.7/extras/libargon2/src/argon2.o
  unable to execute 'i686-linux-gnu-gcc': No such file or directory
  error: command 'i686-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for argon2-cffi
  Building wheel for bcrypt (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/privacyidea/bin/python /opt/privacyidea/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpK1xZ0f
       cwd: /tmp/pip-install-vbH8ar/bcrypt
  Complete output (19 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-i686-2.7
  creating build/lib.linux-i686-2.7/bcrypt
  copying src/bcrypt/__about__.py -> build/lib.linux-i686-2.7/bcrypt
  copying src/bcrypt/__init__.py -> build/lib.linux-i686-2.7/bcrypt
  running build_ext
  generating cffi module 'build/temp.linux-i686-2.7/_bcrypt.c'
  creating build/temp.linux-i686-2.7
  building '_bcrypt' extension
  creating build/temp.linux-i686-2.7/build
  creating build/temp.linux-i686-2.7/build/temp.linux-i686-2.7
  creating build/temp.linux-i686-2.7/src
  creating build/temp.linux-i686-2.7/src/_csrc
  i686-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-EBAgX8/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Isrc/_csrc -I/usr/include/python2.7 -c build/temp.linux-i686-2.7/_bcrypt.c -o build/temp.linux-i686-2.7/build/temp.linux-i686-2.7/_bcrypt.o
  unable to execute 'i686-linux-gnu-gcc': No such file or directory
  error: command 'i686-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for bcrypt
Failed to build cryptography argon2-cffi bcrypt
ERROR: Could not build wheels for cryptography, argon2-cffi, bcrypt which use PEP 517 and cannot be installed directly

I searched around and didn’t really get anywhere with this. Am I doing something wrong here?

Hi and welcome to the forum,
it looks like You don’t have a C-compiler (gcc) installed. Some Python packages require libraries which are compiled at install time.
Please check if the installation works after installing gcc.
Also according to the log You are using Python 2.7 which is deprecated. If possible switch to Python 3.

OK, I think that helped. I installed GCC and found I already had Python 3, just needed to use python3 instead of python. With all that done, I started the process anew.

I think I’ve made progress, but I’m still getting a similar error here:

 Building wheel for cryptography (PEP 517) ... error
ERROR: Command errored out with exit status 1:
   command: /opt/privacyidea/bin/python /opt/privacyidea/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmptvsfad2i
       cwd: /tmp/pip-install-2f8jadu8/cryptography
  Complete output (137 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-i686-3.7
  creating build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/fernet.py -> build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/utils.py -> build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/__about__.py -> build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/__init__.py -> build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/exceptions.py -> build/lib.linux-i686-3.7/cryptography
  creating build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/oid.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/__init__.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/ocsp.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/base.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/name.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/general_name.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/certificate_transparency.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/extensions.py -> build/lib.linux-i686-3.7/cryptography/x509
  creating build/lib.linux-i686-3.7/cryptography/hazmat
  copying src/cryptography/hazmat/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat
  copying src/cryptography/hazmat/_der.py -> build/lib.linux-i686-3.7/cryptography/hazmat
  copying src/cryptography/hazmat/_oid.py -> build/lib.linux-i686-3.7/cryptography/hazmat
  creating build/lib.linux-i686-3.7/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends
  creating build/lib.linux-i686-3.7/cryptography/hazmat/bindings
  copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/bindings
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  creating build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed25519.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/poly1305.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed448.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x448.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ocsp.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x25519.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  creating build/lib.linux-i686-3.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-i686-3.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-i686-3.7/cryptography/hazmat/bindings/openssl
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/pkcs7.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/base.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  running egg_info
  writing src/cryptography.egg-info/PKG-INFO
  writing dependency_links to src/cryptography.egg-info/dependency_links.txt
  writing requirements to src/cryptography.egg-info/requires.txt
  writing top-level names to src/cryptography.egg-info/top_level.txt
  reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/_build'
  warning: no previously-included files found matching 'vectors'
  warning: no previously-included files matching '*' found under directory 'vectors'
  warning: no previously-included files found matching '.travis.yml'
  warning: no previously-included files found matching '.travis'
  warning: no previously-included files matching '*' found under directory '.travis'
  warning: no previously-included files matching '*' found under directory '.github'
  warning: no previously-included files found matching 'release.py'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files found matching 'dev-requirements.txt'
  warning: no previously-included files found matching 'rtd-requirements.txt'
  warning: no previously-included files found matching 'tox.ini'
  warning: no previously-included files matching '*' found under directory '.zuul.d'
  warning: no previously-included files matching '*' found under directory '.zuul.playbooks'
  writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
  running build_ext
  generating cffi module 'build/temp.linux-i686-3.7/_padding.c'
  creating build/temp.linux-i686-3.7
  generating cffi module 'build/temp.linux-i686-3.7/_openssl.c'
  building '_openssl' extension
  creating build/temp.linux-i686-3.7/build
  creating build/temp.linux-i686-3.7/build/temp.linux-i686-3.7
  i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/opt/privacyidea/include -I/usr/include/python3.7m -c build/temp.linux-i686-3.7/_openssl.c -o build/temp.linux-i686-3.7/build/temp.linux-i686-3.7/_openssl.o -Wconversion -Wno-error=sign-conversion
  build/temp.linux-i686-3.7/_openssl.c:575:10: fatal error: openssl/opensslv.h: No such file or directory
   #include <openssl/opensslv.h>
            ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'i686-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for cryptography
  Building wheel for Flask-Script (setup.py) ... done
  Created wheel for Flask-Script: filename=Flask_Script-2.0.6-py3-none-any.whl size=14016 sha256=794bd3970b7facf6424153784ca7d3a63aa458f21b005ec0d7021bc48a7acba9
  Stored in directory: /root/.cache/pip/wheels/b5/fb/6b/01ea56e8a6486540ebe086676c8b3a823f1bbcc830df0cd4f0
  Building wheel for Flask-Versioned (setup.py) ... done
  Created wheel for Flask-Versioned: filename=Flask_Versioned-0.9.4.post20101221-py3-none-any.whl size=3262 sha256=9619b56f6a881f2e69cf130903cca5113d3752aabb39a82ac69cac901c52ea76
  Stored in directory: /root/.cache/pip/wheels/5e/d8/f6/b9c8e5d5ccad74a3a7e568c804bc260a9fab9eeb0cdebc1be0
  Building wheel for huey (setup.py) ... done
  Created wheel for huey: filename=huey-2.3.0-py3-none-any.whl size=68562 sha256=deb39453c1c5fe244627d1ef12d67e79760837caddf536ceba4a928b0e4aa588
  Stored in directory: /root/.cache/pip/wheels/fd/00/92/79bb80619492cde00883bcd7765e0239ffef3b026e14141315
  Building wheel for argon2-cffi (PEP 517) ... done
  Created wheel for argon2-cffi: filename=argon2_cffi-20.1.0-cp37-abi3-linux_i686.whl size=98154 sha256=764c6087ed8574a3455e1f8805d09274779d1a21f1f6f669d5186159ba47b711
  Stored in directory: /root/.cache/pip/wheels/57/12/fd/e064dbe3ee0236aa6c8c6c318a18821413886309a24e5f8fe7
  Building wheel for PyYAML (setup.py) ... done
  Created wheel for PyYAML: filename=PyYAML-5.3.1-cp37-cp37m-linux_i686.whl size=44618 sha256=3bf6c688329f5947ec42b929bb5b529d4d0183c2f1ed2a9a8d6e2c83743f163d
  Stored in directory: /root/.cache/pip/wheels/5e/03/1e/e1e954795d6f35dfc7b637fe2277bff021303bd9570ecea653
  Building wheel for SQLAlchemy (setup.py) ... done
  Created wheel for SQLAlchemy: filename=SQLAlchemy-1.3.20-cp37-cp37m-linux_i686.whl size=1255098 sha256=f6fe35313955cb34a718c14b314204e2062f458d54cfd7438811325e13097efd
  Stored in directory: /root/.cache/pip/wheels/ac/bb/57/2689a5882d1ff27ef254b96835b079f2ab0c4da0d0785a4112
  Building wheel for sqlsoup (setup.py) ... done
  Created wheel for sqlsoup: filename=sqlsoup-0.9.1-py3-none-any.whl size=6767 sha256=c73870dfb270eb49f613d3511932a71cb724aecc0668ef39776466346e834f7c
  Stored in directory: /root/.cache/pip/wheels/39/21/6a/66af69e014487105c1c5f53490bee9f7b7b27c89cb47fc3e13
  Building wheel for bcrypt (PEP 517) ... done
  Created wheel for bcrypt: filename=bcrypt-3.2.0-cp37-cp37m-linux_i686.whl size=64640 sha256=c4ba6505bd3f9284dce150034604536879fbaab3f5887b5c57364219d2a71cca
  Stored in directory: /root/.cache/pip/wheels/c8/ef/5b/5866ddf8e9944d7968fcb3782ad6a68f234bdd13ec3b04ee7c
Successfully built privacyidea cbor2 configobj Flask-Script Flask-Versioned huey argon2-cffi PyYAML SQLAlchemy sqlsoup bcrypt
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
(privacyidea) root@mfa:/opt/privacyidea#

It has some successes after all the errors, but otherwise this appears to be what happened the other day. Are there any other build dependencies besides GCC? I don’t see any looking through the documentation.
Thanks!

Well, it is missing the openssl development package.
But usually it should not be necessary to build the packages, they should be available as wheels:

How do You install the virtual environment and privacyIDEA? Are You using an exotic OS or architecture?

No, I’m running Debian 10 on a regular x86 machine as far as I know.

I installed PIP the regular way so it looks like I should have the wheel and not the system version (I did not specify --no-binary)

I installed virtualenv I believe by doing something like python3 -pip virtualenv [command] - it was something like that. I remember I had to specify pip before virtualenv or it would not work.

I’ve been following along using the links linked in the Privacy Idea documentation, using only the official recommended instructions. This seems to the best way, as I’m not using Ubuntu so there is no package available.

Here are the steps i did:

  • install virtualenv:
    • apt-get install virtualenv python3-virtualenv
  • create virtualenv:
    • virtualenv -p /usr/bin/python3 venv
  • activate virtualenv:
    • . venv/bin/activate
  • install stuff:
    • (venv) pip install cryptography

All packages installed as wheels:

Collecting cryptography
  Using cached cryptography-3.2.1-cp35-abi3-manylinux2010_x86_64.whl (2.6 MB)
Collecting cffi!=1.11.3,>=1.8
  Using cached cffi-1.14.3-cp37-cp37m-manylinux1_x86_64.whl (401 kB)
Collecting six>=1.4.1
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting pycparser
  Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
Installing collected packages: pycparser, cffi, six, cryptography
Successfully installed cffi-1.14.3 cryptography-3.2.1 pycparser-2.20 six-1.15.0

Thank you! I tried following those exact steps, but I seem to be getting the same error.
Is it possible there are other dependencies for the cryptography package it won’t automatically install?

Typically Debian will install dependencies like that if desired but I’m not as familiar with PIP.
Thanks again!

  ERROR: Command errored out with exit status 1:
   command: /home/mfa/venv/bin/python3 /home/mfa/venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp46zc4tgs
       cwd: /tmp/pip-install-0d73zjbj/cryptography
  Complete output (137 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-i686-3.7
  creating build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/fernet.py -> build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/utils.py -> build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/__about__.py -> build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/__init__.py -> build/lib.linux-i686-3.7/cryptography
  copying src/cryptography/exceptions.py -> build/lib.linux-i686-3.7/cryptography
  creating build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/oid.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/__init__.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/ocsp.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/base.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/name.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/general_name.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/certificate_transparency.py -> build/lib.linux-i686-3.7/cryptography/x509
  copying src/cryptography/x509/extensions.py -> build/lib.linux-i686-3.7/cryptography/x509
  creating build/lib.linux-i686-3.7/cryptography/hazmat
  copying src/cryptography/hazmat/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat
  copying src/cryptography/hazmat/_der.py -> build/lib.linux-i686-3.7/cryptography/hazmat
  copying src/cryptography/hazmat/_oid.py -> build/lib.linux-i686-3.7/cryptography/hazmat
  creating build/lib.linux-i686-3.7/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends
  copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends
  creating build/lib.linux-i686-3.7/cryptography/hazmat/bindings
  copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/bindings
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives
  creating build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed25519.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/poly1305.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ed448.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x448.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/ocsp.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/x25519.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-i686-3.7/cryptography/hazmat/backends/openssl
  creating build/lib.linux-i686-3.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-i686-3.7/cryptography/hazmat/bindings/openssl
  copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-i686-3.7/cryptography/hazmat/bindings/openssl
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/kdf
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/asymmetric
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/twofactor
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/pkcs7.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  copying src/cryptography/hazmat/primitives/serialization/base.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/serialization
  creating build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.linux-i686-3.7/cryptography/hazmat/primitives/ciphers
  running egg_info
  writing src/cryptography.egg-info/PKG-INFO
  writing dependency_links to src/cryptography.egg-info/dependency_links.txt
  writing requirements to src/cryptography.egg-info/requires.txt
  writing top-level names to src/cryptography.egg-info/top_level.txt
  reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/_build'
  warning: no previously-included files found matching 'vectors'
  warning: no previously-included files matching '*' found under directory 'vectors'
  warning: no previously-included files found matching '.travis.yml'
  warning: no previously-included files found matching '.travis'
  warning: no previously-included files matching '*' found under directory '.travis'
  warning: no previously-included files matching '*' found under directory '.github'
  warning: no previously-included files found matching 'release.py'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files found matching 'dev-requirements.txt'
  warning: no previously-included files found matching 'rtd-requirements.txt'
  warning: no previously-included files found matching 'tox.ini'
  warning: no previously-included files matching '*' found under directory '.zuul.d'
  warning: no previously-included files matching '*' found under directory '.zuul.playbooks'
  writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
  running build_ext
  generating cffi module 'build/temp.linux-i686-3.7/_padding.c'
  creating build/temp.linux-i686-3.7
  generating cffi module 'build/temp.linux-i686-3.7/_openssl.c'
  building '_openssl' extension
  creating build/temp.linux-i686-3.7/build
  creating build/temp.linux-i686-3.7/build/temp.linux-i686-3.7
  i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -I/home/mfa/venv/include/python3.7m -c build/temp.linux-i686-3.7/_openssl.c -o build/temp.linux-i686-3.7/build/temp.linux-i686-3.7/_openssl.o -Wconversion -Wno-error=sign-conversion
  build/temp.linux-i686-3.7/_openssl.c:575:10: fatal error: openssl/opensslv.h: No such file or directory
   #include <openssl/opensslv.h>
            ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'i686-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

Such errors usually indicate that you are missing the headers file, i.e. development packages.