DevC
DevC

Reputation: 7433

Tornado import error

I have installed tornado and following works fine, I am able to run hello,world app

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

Upvotes: 1

Views: 2104

Answers (1)

Nafiul Islam
Nafiul Islam

Reputation: 82590

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.

Upvotes: 3

Related Questions