Having problems importing wtforms in vscode Venv and would appreciate some help.
My import statements:
from wtforms import Form, BooleanField, StringField, PasswordField, validators
from flask_wtf import Form
from flask_wtf import FlaskForm
Console output:
ModuleNotFoundError: No module named 'wtforms'
Flask and wtforms are installed:
pip install -U WTForms
Requirement already satisfied: WTForms ...
pip install -U flask-wtf
Requirement already satisfied: flask-wtf in ...
Any ideas?
Create your virtual environment in vs code
Than
pip install -U WTForms
pip install -U flask-wtf
And your import statement is right .
Create your virtual environment in Windows
C:\\Users\\Owner> cd desktop
C:\\Users\\Owner\\desktop>
C:\\Users\\Owner> cd desktop
C:\\Users\\Owner\\desktop> py -m venv env
C:\\Users\\Owner\\desktop> dir
...
...
05/13/2020 06:40 PM env
C:\\Users\\Owner\\desktop> cd env
C:\\Users\\Owner\\desktop\\env> Scripts\\activate
(env)C:\\Users\\Owner\\desktop\\env>
(env)C:\\Users\\Owner\\desktop\\env> deactivate
C:\\Users\\Owner\\desktop\\env>
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.