Using the Vendored Argon2¶
python -m pip install argon2-cffi
should be all it takes.
argon2-cffi vendors Argon2’s C code by default, it can lead to complications depending on the platform.
The C code is known to compile and work on all common platforms (including x86, ARM, and PPC). On x86, an SSE2-optimized version is used.
If something goes wrong, please try to update your
python -m pip install -U cffi pip setuptools
Overall this should be the safest bet because
argon2-cffi has been specifically tested against the vendored version.
Using a System-wide Installation of Argon2¶
If you set
1 (and only
argon2-cffi will not build its bindings.
However binary wheels are preferred by
pip and Argon2 gets installed along with
Therefore you also have to instruct
pip to use a source distribution:
env ARGON2_CFFI_USE_SYSTEM=1 \ python -m pip install --no-binary=argon2-cffi argon2-cffi
This approach can lead to problems around your build chain and you can run into incompatibilities between Argon2 and
argon2-cffi if the latter has been tested against a different version.
It is your own responsibility to deal with these risks if you choose this path.
Available since version 18.1.0.
Override Automatic SSE2 Detection¶
Usually the build process tries to guess whether or not it should use SSE2-optimized code. This can go wrong and is problematic for cross-compiling.
Therefore you can use the
ARGON2_CFFI_USE_SSE2 environment variable to control the process:
If you set it to
argon2-cffiwill build with SSE2 support.
If you set it to
argon2-cffiwill build without SSE2 support.
If you set it to anything else, it will be ignored and
argon2-cffiwill try to guess.
Available since version 20.1.0.