简体   繁体   中英

Unable to import flask_login

I am following the book explore flask on explore flask site, I am getting this error, I just installed flask-login and import this as following

pip install flask-login

from flask_login import login_required

I expect to save this normally without any errors, but VS CODE terminal show this error "Unable to import 'flask_login'

  • First , make sure that flask_login was installed successfully by running "pip list" in your project directory terminal, If it isn't there then you should install it again
  • Second , if it is there so make sure of any typo mistakes, also you can share that piece of code to check it.

Make sure you have installed the version of Flask-Login which is compatible with your Python Version. If you're using Python 3 in your Flask App you need pip3 to install compatible parts.

Try:

sudo apt install python3-pip

Then:

pip3 install flask-login

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM