-1

I've seen web.py recommended in some places as a simple python web framework that I could use in my raspberry, so I went ahead and installed it via PIP (sudo pip install web.py).

But when I try to run its hello-world web app (like it's said in the tutorial), it gives this error:

$ python code.py 
Traceback (most recent call last):
  File "code.py", line 1, in <module>
    import web
  File "/home/myuser/mywebapp/web.py", line 6, in <module>
AttributeError: 'module' object has no attribute 'application'

What's wrong here? Should I install it from the tarball instead?

  • 4
    Please edit your question and add your code. – Steve Robillard Aug 31 '16 at 16:43
  • the code is exactly like the one in the tutorial, that's why I added a link to it – knocte Oct 12 '16 at 2:12
1

I would suggest you to refer the answer below.

https://stackoverflow.com/questions/6412442/web-py-attributeerror-module-object-has-no-attribute-application

If so when you do import web you are importing your package not the actual web.py. Rename it, or reorder your pythonpath.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.