Question

I just installed the flaskext package on my computer and I get the following error when I import a form...

Running this...

from flaskext.wtf import Form

Generated this error...

Traceback (most recent call last):
  File "/home/nater/predwebapp/flask_main.py", line 1, in <module>
    from flaskext.wtf import Form
  File "/usr/lib/python2.7/dist-packages/flaskext/wtf/__init__.py", line 72, in <module>
    __all__ += fields.__all__
AttributeError: 'module' object has no attribute '__all__'

Not sure where to go from here. I thought it might have been an installation error so I tried reinstalling the package, but the result was the same. I'm using python 2.7.3 on Ubuntu 12.04.

Was it helpful?

Solution

If you have the latest version , you need to update the

from flaskext.wtf import Form

to

from flask.ext.wtf import Form

Notice the dot. Flask has changed how you call the extension modules since a few versions ago in general. Please see http://pythonhosted.org/Flask-WTF/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top