<p>当我用virtualenv安装新服务器时,我也遇到了同样的问题。在</p>
<p>这是我安装烧瓶时的输出:</p>
<pre><code>$ pip install flask
Collecting flask
Downloading
....
Building wheels for collected packages: itsdangerous, MarkupSafe
Running setup.py bdist_wheel for itsdangerous ... done
....
Successfully built itsdangerous MarkupSafe
Installing collected packages: click, Werkzeug, itsdangerous, MarkupSafe, Jinja2, flask
Successfully installed Jinja2-2.10 MarkupSafe-1.0 Werkzeug-0.14.1 click-6.7 flask-1.0.2 itsdangerous-0.24
</code></pre>
<p>我试着运行最小的脚本:</p>
^{pr2}$
<p>我所理解的是没有安装WTFORMS。
我在另一篇文章中搜索,这对我很有用(<a href="https://stackoverflow.com/questions/45660399/how-can-i-import-flask-wtf">How can I import Flask-WTF?</a>):</p>
<pre><code>$ pip install flask-wtf
Collecting flask-wtf
Downloading
....
Collecting WTForms (from flask-wtf)
Downloading
....
100% |████████████████████████████████| 174kB 345kB/s
Requirement already satisfied: Flask in ./lib/python2.7/site-packages (from flask-wtf) (1.0.2)
Requirement already satisfied: click>=5.1 in ./lib/python2.7/site-packages (from Flask->flask-wtf) (6.7)
Requirement already satisfied: Werkzeug>=0.14 in ./lib/python2.7/site-packages (from Flask->flask-wtf) (0.14.1)
Requirement already satisfied: itsdangerous>=0.24 in ./lib/python2.7/site-packages (from Flask->flask-wtf) (0.24)
Requirement already satisfied: Jinja2>=2.10 in ./lib/python2.7/site-packages (from Flask->flask-wtf) (2.10)
Requirement already satisfied: MarkupSafe>=0.23 in ./lib/python2.7/site-packages (from Jinja2>=2.10->Flask->flask-wtf) (1.0)
Installing collected packages: WTForms, flask-wtf
Successfully installed WTForms-2.2.1 flask-wtf-0.14.2
</code></pre>