Troubleshooting - kdaisho/Blog GitHub Wiki
(trapped) error reading bcrypt version
File "/usr/lib/python3/dist-packages/passlib/handlers/bcrypt.py", line 619, in _load_backend_mixin
version = _bcrypt.__about__.__version__
This is because passlib expects bcrypt version 4.0.1. The latest version of bcrypt (4.2.0 at Feb 2025) doesn't have about attribute.
I fixed this by patching passlib as follows:
Open the file:
sudo vim `/usr/lib/python3/dist-packages/passlib/handlers/bcrypt.py`
Replace this:
version = _bcrypt.__about__.__version__
With this:
version = getattr(_bcrypt, '__version__', '<unknown>')
This is not the best solution as upgrading the language will overwrite it, but it does the job for now.