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.

basically PIP should do the same, it is a package manager for Python packages.
The issue here is that it is unable to download/install binary packages on Your system and thus wants to rebuild all the necessary Python extension (which fails because the required development packages are missing on the system).
Could You post the complete output of pip debug -v here to see which binary tags are compatible to Your system?

Sorry for the delay, here is pip -v:

root@mfa:/home/mfa# pip debug -v
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
pip version: pip 20.2.4 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
sys.version: 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0]
sys.executable: /usr/bin/python
sys.getdefaultencoding: ascii
sys.getfilesystemencoding: UTF-8
locale.getpreferredencoding: UTF-8
sys.platform: linux2
sys.implementation:
  name:
'cert' config value: Not specified
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): /usr/local/lib/python2.7/dist-packages/pip/_vendor/certifi/cacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:
  packaging==20.4
  toml==0.10.1
  pyparsing==2.4.7
  html5lib==1.1
  appdirs==1.4.4
  distlib==0.3.1
  msgpack==1.0.0 (Unable to locate actual module version, using vendor.txt specified version)
  six==1.15.0
  webencodings==0.5.1 (Unable to locate actual module version, using vendor.txt specified version)
  progress==1.5
  certifi==2020.06.20
  distro==1.5.0 (Unable to locate actual module version, using vendor.txt specified version)
  urllib3==1.25.9
  retrying==1.3.3 (Unable to locate actual module version, using vendor.txt specified version)
  resolvelib==0.4.0
  colorama==0.4.3
  CacheControl==0.12.6
  ipaddress==1.0.23
  pep517==0.8.2
  contextlib2==0.6.0.post1 (Unable to locate actual module version, using vendor.txt specified version)
  chardet==3.0.4
  setuptools==44.0.0 (Unable to locate actual module version, using vendor.txt specified version)
  requests==2.24.0
  idna==2.10
Compatible tags: 54
  cp27-cp27mu-manylinux2014_i686
  cp27-cp27mu-manylinux2010_i686
  cp27-cp27mu-manylinux1_i686
  cp27-cp27mu-linux_i686
  cp27-none-manylinux2014_i686
  cp27-none-manylinux2010_i686
  cp27-none-manylinux1_i686
  cp27-none-linux_i686
  py27-none-manylinux2014_i686
  py27-none-manylinux2010_i686
  py27-none-manylinux1_i686
  py27-none-linux_i686
  py2-none-manylinux2014_i686
  py2-none-manylinux2010_i686
  py2-none-manylinux1_i686
  py2-none-linux_i686
  py26-none-manylinux2014_i686
  py26-none-manylinux2010_i686
  py26-none-manylinux1_i686
  py26-none-linux_i686
  py25-none-manylinux2014_i686
  py25-none-manylinux2010_i686
  py25-none-manylinux1_i686
  py25-none-linux_i686
  py24-none-manylinux2014_i686
  py24-none-manylinux2010_i686
  py24-none-manylinux1_i686
  py24-none-linux_i686
  py23-none-manylinux2014_i686
  py23-none-manylinux2010_i686
  py23-none-manylinux1_i686
  py23-none-linux_i686
  py22-none-manylinux2014_i686
  py22-none-manylinux2010_i686
  py22-none-manylinux1_i686
  py22-none-linux_i686
  py21-none-manylinux2014_i686
  py21-none-manylinux2010_i686
  py21-none-manylinux1_i686
  py21-none-linux_i686
  py20-none-manylinux2014_i686
  py20-none-manylinux2010_i686
  py20-none-manylinux1_i686
  py20-none-linux_i686
  cp27-none-any
  py27-none-any
  py2-none-any
  py26-none-any
  py25-none-any
  py24-none-any
  py23-none-any
  py22-none-any
  py21-none-any
  py20-none-any

OK, I’ve made progress. Thank you!

For some reason, the wheel didn’t seem to do the trick. once I did apt-get install libssl I think it was, the pip cryptography install succeeded and the regular install succeeded too:

Successfully built privacyidea cbor2 configobj cryptography Flask-Script Flask-Versioned huey argon2-cffi PyYAML SQLAlchemy sqlsoup bcrypt
Installing collected packages: soupsieve, lxml, beautifulsoup4, cbor2, six, configobj, python-dateutil, natsort, croniter, pycparser, cffi, cryptography, defusedxml, ecdsa, MarkupSafe, Jinja2, itsdangerous, Werkzeug, click, Flask, pytz, Babel, Flask-Babel, SQLAlchemy, Flask-SQLAlchemy, Mako, python-editor, alembic, Flask-Migrate, Flask-Script, Flask-Versioned, redis, huey, pyasn1, ldap3, netaddr, httplib2, rsa, pyasn1-modules, oauth2client, bcrypt, passlib, argon2-cffi, Pillow, PyJWT, PyMySQL, pyOpenSSL, pyrad, python-gnupg, PyYAML, qrcode, chardet, certifi, urllib3, idna, requests, smpplib, sqlsoup, privacyidea
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/opt/privacyidea/lib/python3.7/site-packages/soupsieve'
Consider using the `--user` option or check the permissions.

WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available.
You should consider upgrading via the '/opt/privacyidea/bin/python -m pip install --upgrade pip' command.
(privacyidea) mfa@mfa:/opt/privacyidea$

There is an error about it not being able to install the soupsieve packages for some reason. I can’t think what would be special there. But it seems like privacyidea itself was successfully installed and so I can try to proceed from here - or should I retry the installation until soupsieve also works? It seems like it didn’t get created:

(privacyidea) mfa@mfa:/opt/privacyidea$ ls -l /opt/privacyidea/lib/python3.7/site-packages/soupsieve
ls: cannot access '/opt/privacyidea/lib/python3.7/site-packages/soupsieve': No such file or directory
(privacyidea) mfa@mfa:/opt/privacyidea$ ls -l /opt/privacyidea/lib/python3.7/site-packages/
total 56
drwxr-xr-x 3 root root 4096 Nov 18 20:13 _distutils_hack
-rw-r--r-- 1 root root  152 Nov 18 20:13 distutils-precedence.pth
-rw-r--r-- 1 root root  126 Nov 18 20:13 easy_install.py
drwxr-xr-x 5 root root 4096 Nov 18 20:13 pip
drwxr-xr-x 2 root root 4096 Nov 18 20:13 pip-20.2.4.dist-info
-rw-r--r-- 1 root root    0 Nov 18 20:13 pip-20.2.4.virtualenv
drwxr-xr-x 5 root root 4096 Nov 18 20:13 pkg_resources
drwxr-xr-x 2 root root 4096 Nov 18 20:13 __pycache__
drwxr-xr-x 7 root root 4096 Nov 18 20:13 setuptools
drwxr-xr-x 2 root root 4096 Nov 18 20:13 setuptools-50.3.2.dist-info
-rw-r--r-- 1 root root    0 Nov 18 20:13 setuptools-50.3.2.virtualenv
-rw-r--r-- 1 root root   18 Nov 18 20:13 _virtualenv.pth
-rw-r--r-- 1 root root 5662 Nov 18 20:13 _virtualenv.py
drwxr-xr-x 5 root root 4096 Nov 18 20:13 wheel
drwxr-xr-x 2 root root 4096 Nov 18 20:13 wheel-0.35.1.dist-info
-rw-r--r-- 1 root root    0 Nov 18 20:13 wheel-0.35.1.virtualenv

First, the pip output is from the (default) Python 2.7. You should run the pip command in the activated Python 3 virtualenv.
Also it looks like You are running this on a 32 bit machine. The cryptography package only supplies wheels for 64 bit, so building the packages is the only option here.
The soupsieve package is needed for import/export of tokens via (XML) files. Maybe try re-installing it directly.

i have a Running Cluster with Galery 4 on Debian 10. if there´s help needed with the set up i can help… it definitely works and is just a little bit more Work than on Ubuntu (you can even use the Ubuntu repository for Freeradius if you dont want to modify the files)

Hey, thanks for the note!

Are you saying that if we used the Ubuntu repo, that would work as a drop in compatability package on Debian, with no other tweaks needed?
As in:

add-apt-repository ppa:privacyidea/privacyidea
apt-get install privacyidea

is all that would be needed?

I might decide to go that route then, assuming that’s stable.

Given the note about somehow having x86, and some IT upgrades that have been going on, I’ll be setting up a new server using a virtual machine rather than directly on bare metal. I’m partial to Debian 10 rather than clunky Ubuntu GUIs and from a server stability standpoint would prefer to go that route as well.

The ppa repo is deprecated. Use it, if you want to use old software!
Check the install chapter of the documentation at readthedocs!

“clunky Ubuntu GUIs”? Who on earth would install privacyIDEA on a Ubuntu desktop?
You wouldn’t install it on a Debian desktop, either?

~~

@Last_auth_standing said you could use privacyidea-radius (since this is only perl code). You can not use the privacyidea package. Might break a lot.