Installation

Supported Platforms

Passlib requires Python 2 (>= 2.6) or Python 3 (>= 3.3). It is known to work with the following Python implementations:

  • CPython 2 – v2.6 or newer.
  • CPython 3 – v3.3 or newer.
  • PyPy – v2.0 or newer.
  • PyPy3 – v5.3 or newer.
  • Jython – v2.7 or newer.
  • Pyston – v0.5.1 or newer.

Passlib should work with all operating systems and environments, as it contains builtin fallbacks for almost all OS-dependant features. Google App Engine is supported as well.

Changed in version 1.7: Support for Python 2.5, 3.0-3.2 was dropped. Support for PyPy 1.x was dropped.

Optional Libraries

  • bcrypt, py-bcrypt, or bcryptor

    If any of these packages are installed, they will be used to provide support for the BCrypt hash algorithm. This is required if you want to handle BCrypt hashes, and your OS does not provide native BCrypt support via stdlib’s crypt (which includes pretty much all non-BSD systems).

    bcrypt is currently the recommended option – it’s actively maintained, and compatible with both CPython and PyPy.

    Use pip install passlib[bcrypt] to get the recommended bcrypt setup.

  • argon2_cffi, or argon2pure (>= 1.2.2)

    If any of these packages are installed, they will be used to provide support for the argon2 hash algorithm. argon2_cffi is currently the recommended option.

    Use pip install passlib[argon2] to get the recommended argon2 setup.

  • Cryptography

    If installed, will be used to enable encryption of TOTP secrets for storage (see passlib.totp).

    Use pip install passlib[totp] to get the recommended TOTP setup.

  • fastpbk2

    If installed, will be used to greatly speed up pbkdf2_hmac(), and any pbkdf2-based hashes.

  • SCrypt (>= 0.6)

    If installed, this will be used to provide support for the scrypt hash algorithm. If not installed, a MUCH slower builtin reference implementation will be used.

Changed in version 1.7: Added fastpbkdf2, cryptography, argon2_cffi, argon2pure, and scrypt support. Removed M2Crypto support.

Installation Instructions

To install from PyPi using pip:

pip install passlib

To install from the source using setup.py:

python setup.py install