shogun-toolbox/shogun-cloud

No module named flask.ext.wtf

abinashmeher999 opened this issue · 0 comments

While trying to run app.py, I got the following error

abinashmeher999@JARVIS:~/shogun-cloud/webapp$ ./app.py 
Traceback (most recent call last):
  File "./app.py", line 9, in <module>
    from flask.ext.wtf import Form, TextField
  File "/usr/local/lib/python2.7/dist-packages/flask/exthook.py", line 87, in load_module
    raise ImportError('No module named %s' % fullname)
ImportError: No module named flask.ext.wtf.TextField

The problem is I am using a newer version of flask.ext.wtf and since version 0.9.0 the import style has changed as mentioned here.

You are probably using the import style from the older versions:

from flask.ext.wtf import Form, TextField, BooleanField
from flask.ext.wtf import Required

The import style changed starting from 0.9.0 version. Be sure to update your imports:

from flask.ext.wtf import Form
from wtforms.fields import TextField, BooleanField
from wtforms.validators import Required

I have already tried it and it works.(on my system)
Should we update it accordingly? Or it might cause some problems since it would also need the newer version?