from flask import Flask
from flask.ext.bcrypt import Bcrypt
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from flask import Flask
>>> from flask.ext.bcrypt import Bcrypt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named ext.bcrypt
我已安装烧瓶bcrypt:
pip install Flask-Bcrypt
Requirement already satisfied: Flask-Bcrypt in /usr/local/lib/python2.7/dist-packages (0.7.1)
Requirement already satisfied: Flask in /usr/local/lib/python2.7/dist-packages (from Flask-Bcrypt) (1.0.2)
Requirement already satisfied: bcrypt in /usr/local/lib/python2.7/dist-packages/bcrypt-3.1.4-py2.7-linux-x86_64.egg (from Flask-Bcrypt) (3.1.4)
Requirement already satisfied: Jinja2>=2.10 in /usr/local/lib/python2.7/dist-packages/Jinja2-2.10-py2.7.egg (from Flask->Flask-Bcrypt) (2.10)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python2.7/dist-packages (from Flask->Flask-Bcrypt) (0.24)
Requirement already satisfied: Werkzeug>=0.14 in /usr/local/lib/python2.7/dist-packages (from Flask->Flask-Bcrypt) (0.14.1)
Requirement already satisfied: click>=5.1 in /usr/local/lib/python2.7/dist-packages (from Flask->Flask-Bcrypt) (6.7)
Requirement already satisfied: cffi>=1.1 in /usr/local/lib/python2.7/dist-packages/cffi-1.11.5-py2.7-linux-x86_64.egg (from bcrypt->Flask-Bcrypt) (1.11.5)
Requirement already satisfied: six>=1.4.1 in /usr/local/lib/python2.7/dist-packages/six-1.10.0-py2.7.egg (from bcrypt->Flask-Bcrypt) (1.10.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/dist-packages/MarkupSafe-1.0-py2.7-linux-x86_64.egg (from Jinja2>=2.10->Flask->Flask-Bcrypt) (1.0)
Requirement already satisfied: pycparser in /usr/local/lib/python2.7/dist-packages/pycparser-2.18-py2.7.egg (from cffi>=1.1->bcrypt->Flask-Bcrypt) (2.18)
这个错误让我无处可去。我按照这里的文件:
https://flask-bcrypt.readthedocs.io/en/latest/