Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Tornado: WSGI module missing?

I did a pip install tornado but I cannot run the following code because WSGI module is missing??

http://flask.pocoo.org/docs/deploying/wsgi-standalone/

from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from myapp import app

http_server = HTTPServer(WSGIContainer(app))
http_server.listen(5000)
IOLoop.instance().start()
like image 268
I Love Python Avatar asked Dec 10 '13 21:12

I Love Python


1 Answers

If your file is named tornado.py, it will try to import things from that file instead of the directory on site-packages. This is probably the most common source of "no module named X" ImportErrors. Rename the file and it should work.

After you rename the file from tornado.py to something else, also delete the tornado.pyc that got created.

like image 118
Ben Darnell Avatar answered Sep 21 '22 10:09

Ben Darnell