문제

I already installed py-bcrypt and bcrypt.

import bcrypt
from eve import Eve
from eve.auth import BasicAuth

password = u'password'
password_hashed = bcrypt.hashpw(password, bcrypt.gensalt())
print password_hashed

File "/var/www/eve2/bcrypt.py", line 19, in <module>
password_hashed = bcrypt.hashpw(password, bcrypt.gensalt())
AttributeError: 'module' object has no attribute 'hashpw'
도움이 되었습니까?

해결책

You need to rename your file to something other than bcrypt.py. Right now, your script is trying to import itself.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top