pytype
pytype copied to clipboard
Can't find module 'passlib.hash'. [import-error]
I have a line that says:
from passlib.hash import argon2
which works fine, but ptype says:
Can't find module 'passlib.hash'. [import-error]
Looks like passlib is a third party library - how did you install it? pytype should be able to discover most pip-installed libraries.
It was installed with pip. You should be able to reproduce the error by doing:
python3.7 -m venv /tmp/p
/tmp/p/bin/pip install pytype
/tmp/p/bin/pip install passlib
echo "from passlib.hash import argon2" >/tmp/p/p.py
. /tmp/p/bin/activate
pytype /tmp/p/p.py
Thanks! I was able to reproduce the error.
pytype does not report any errors on a file containing "import passlib.hash", so this doesn't seem to be a problem of the library not being found at all - it's probably a bug in load_pytd.py.