ImportError: No module named twisted.websocket

时间:2015-07-31 20:29:33

标签: python python-2.7 twisted autobahn

I have tried one of example web-socket client codes in autobahn web site. But it gives me the error

ImportError: No module named twisted.websocket

even though I have already installed autobahn. When I try to install "twisted" explicitly it tells me that "twisted" is already installed. I'm working on a Ubuntu machine.

2 个答案:

答案 0 :(得分:0)

您正在尝试导入一个不存在(并且从未拥有)的模块twisted.websocket。该示例具有模块autobahn.twisted.websocket,它是高速公路的一部分,而不是扭曲。

答案 1 :(得分:0)

文档似乎已过时/不准确。尝试:

from autobahn.websocket import WebSocketServerProtocol