python - ImportError:from flask_wtf import FlaskForm
阿神
阿神 2017-04-18 09:35:15
0
1
1067

大家好,关于flask_wtf,官网上的实例

from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class MyForm(FlaskForm): name = StringField('name', validators=[DataRequired()])

第一行这样的引入方式,我怎么尝试不成功?在pytone IDE中提示:

ImportError: cannot import name FlaskForm


如果按常规的引入方式:

from flask_wtf import Form

pythone IDE是没问题,但在pycharm中,会有异常提示:

This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items


以上,求解?

  1. 官网的例子是错的吗?

  2. pycharm中为什么公有波浪提示?

阿神
阿神

闭关修行中......

reply all (1)
伊谢尔伦
    The example on the
  1. official website is correct, but it is version 0.13. You are viewing the documentation oflatest, and the address of version 0.12 is https://flask-wtf.readthedocs..., but the problem is that the highest on pypi is only 0.12 , that is to say, although there is version 0.13 now, the author has not failed to publish it, but the documentation has been updated. If you want to install the latest version, you have to use the source code to install it

  2. The wavy lines in PyCharm indicate that the module is not used in the current file

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!