python bcrypt问题,找不到模块

时间:2014-05-14 02:11:13

标签: python bcrypt eve

我已经安装了py-bcrypt和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'

1 个答案:

答案 0 :(得分:3)

您需要将文件重命名为bcrypt.py以外的其他文件。现在,您的脚本正在尝试导入自己。