Python Tornado:缺少WSGI模块?

I L*_*hon 5 python tornado flask

我做了一个,pip install tornado但我无法运行以下代码,因为WSGI模块丢失了?

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()
Run Code Online (Sandbox Code Playgroud)

Ben*_*ell 13

如果您的文件名为tornado.py,它将尝试从该文件而不是site-packages上的目录导入内容.这可能是"没有名为X的模块"ImportErrors的最常见来源.重命名文件,它应该工作.