I am trying to learn Flask, I use Ubuntu 19.04 and I am writing code in VSCode. After following the attached tutorial, I keep having the problem: unresolved import"flask_mysqldb" and the same with wtforms and passlib.
I have installed all requirements, and just to check, I try to install again and I receive the message:'Requirement already satisfied: mysqlclient in "someplace"/.local/lib/python2.7/site-packages
I thought that maybe I am using python 3.7 but it installs itself in 2.7? But it never asked me where to install.
This is the video tutorial I am following: https://www.youtube.com/watch?v=addnlzdSQs4
from flask import Flask, render_template, flash, redirect, url_for, session, loggin
from data import Articles
from flask_mysqldb import MySQL
from wtforms import Form, StringField, TextAreaField, PasswordField, validators
from passlib.hash import sha256_crypt
the first two imports work just fine, the others are underlined with green and receive error messages.
ex:
unresolved import 'flask_mysqldb'
unresolved import 'wtforms'
unresolved import 'passlib.hash'
I have had this problem several times and it often works with just "exiting" VSCode since VSCode sometimes doesnt check the path. It uses the "old" settings or "path". By exiting the program and restarting it it updates this and it works (if its this problem)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With