Python Tornado: WSGI module missing?

耗尽温柔 提交于 2020-01-11 05:37:08

问题


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()

回答1:


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.



来源:https://stackoverflow.com/questions/20505495/python-tornado-wsgi-module-missing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!