当我开始龙卷风时,一个混乱的错误

时间:2013-12-01 04:58:46

标签: python python-2.7 tornado

我是龙卷风的新手。在我使用:

安装Tornado 3.1.1之后
tar xvzf tornado-3.1.1.tar.gz
cd tornado-3.1.1
python setup.py build
sudo python setup.py install

我尝试运行hello world example in the documentation

#!/usr/bin/env python
import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")

application = tornado.web.Application([
    (r"/", MainHandler),
])

if __name__ == "__main__":
    application.listen(8888)
    tornado.ioloop.IOLoop.instance().start()

然后我跑了

python hello.py

我收到了这个错误:

Traceback (most recent call last):
  File "hello.py", line 2, in <module>
    import tornado.ioloop
  File "/usr/share/nginx/www/tornado/tornado/ioloop.py", line 44, in <module>
    from tornado.concurrent import Future, TracebackFuture
  File "/usr/share/nginx/www/tornado/tornado/concurrent.py", line 30, in <module>
    from tornado.stack_context import ExceptionStackContext, wrap
ImportError: No module named stack_context

Python版本:2.7.3

海湾合作委员会:4.6.3

龙卷风:3.1.1

0 个答案:

没有答案