简体   繁体   English

龙卷风导入错误

[英]Tornado import error

I have installed tornado and following works fine, I am able to run hello,world app 我已经安装了龙卷风并且可以正常工作,我可以运行hello,world应用程序

python -c "import tornado"

but following results in error 但是跟随导致错误

python -c ""from tornado.netutil import TCPServer"

Import error 导入错误

Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: cannot import name TCPServer

full code : I am trying to run this https://gist.github.com/phuslu/1231481 完整代码:我正在尝试运行此https://gist.github.com/phuslu/1231481

You made the wrong imports from the wrong package, try the following: 您从错误的包装中导入了错误的内容,请尝试以下操作:

import sys, os, re
import logging

from tornado.ioloop import IOLoop
from tornado.iostream import IOStream
from tornado.tcpserver import TCPServer

as your imports. 作为您的进口。 I've tried and tested it. 我已经尝试和测试过。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM