PyCharm 中没有名为 flask-wtf 的模块
No module named flask-wtf in PyCharm
当我运行这段代码时,from flask_wtf import FlaskForm
我得到一个错误,
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'flask_wtf'
我已经通过CMD安装了flask-wtf包,
pip install flask-wtf
它让我确认软件包已成功安装
Requirement already satisfied: flask-wtf in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (0.15.1)
Requirement already satisfied: WTForms in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from flask-wtf) (2.3.3)
Requirement already satisfied: Flask in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from flask-wtf) (2.0.1)
Requirement already satisfied: itsdangerous in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from flask-wtf) (2.0.1)
Requirement already satisfied: Jinja2>=3.0 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Flask->flask-wtf) (3.0.1)
Requirement already satisfied: Werkzeug>=2.0 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Flask->flask-wtf) (2.0.1)
Requirement already satisfied: click>=7.1.2 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Flask->flask-wtf) (8.0.1)
Requirement already satisfied: colorama in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from click>=7.1.2->Flask->flask-wtf) (0.4.4)
Requirement already satisfied: importlib-metadata in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from click>=7.1.2->Flask->flask-wtf) (4.8.1)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Jinja2>=3.0->Flask->flask-wtf) (2.0.1)
Requirement already satisfied: typing-extensions>=3.6.4 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from importlib-metadata->click>=7.1.2->Flask->flask-wtf) (3.10.0.2)
Requirement already satisfied: zipp>=0.5 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from importlib-metadata->click>=7.1.2->Flask->flask-wtf) (3.5.0)
通过直接从 PyCharm 安装 flask-wtf
包来修复。
ctrl
+ alt
+ S
然后 Python Interpreters
点击 +
符号然后输入 flask-wtf
并下载包。
当我运行这段代码时,from flask_wtf import FlaskForm
我得到一个错误,
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'flask_wtf'
我已经通过CMD安装了flask-wtf包,
pip install flask-wtf
它让我确认软件包已成功安装
Requirement already satisfied: flask-wtf in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (0.15.1)
Requirement already satisfied: WTForms in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from flask-wtf) (2.3.3)
Requirement already satisfied: Flask in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from flask-wtf) (2.0.1)
Requirement already satisfied: itsdangerous in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from flask-wtf) (2.0.1)
Requirement already satisfied: Jinja2>=3.0 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Flask->flask-wtf) (3.0.1)
Requirement already satisfied: Werkzeug>=2.0 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Flask->flask-wtf) (2.0.1)
Requirement already satisfied: click>=7.1.2 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Flask->flask-wtf) (8.0.1)
Requirement already satisfied: colorama in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from click>=7.1.2->Flask->flask-wtf) (0.4.4)
Requirement already satisfied: importlib-metadata in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from click>=7.1.2->Flask->flask-wtf) (4.8.1)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Jinja2>=3.0->Flask->flask-wtf) (2.0.1)
Requirement already satisfied: typing-extensions>=3.6.4 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from importlib-metadata->click>=7.1.2->Flask->flask-wtf) (3.10.0.2)
Requirement already satisfied: zipp>=0.5 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from importlib-metadata->click>=7.1.2->Flask->flask-wtf) (3.5.0)
通过直接从 PyCharm 安装 flask-wtf
包来修复。
ctrl
+ alt
+ S
然后 Python Interpreters
点击 +
符号然后输入 flask-wtf
并下载包。