William
William

Reputation: 531

twisted websockets import error

I'm trying to get WebSocket working in Python with Twisted using this example: http://twistedmatrix.com/trac/export/29073/branches/websocket-4173-2/doc/web/howto/websocket.xhtml. Unfortunately, I'm running into an ImportError. I'm not sure what to do here. I've installed/uninstalled Twisted several times using several methods (from source, from pip, and from Ubuntu repo), and this still pops up.

Traceback (most recent call last):
File "server.py", line 2, in <module>
from twisted.web.websocket import WebSocketHandler, WebSocketSite
ImportError: No module named websocket

Any help is appreciated!

Upvotes: 4

Views: 3866

Answers (1)

djc
djc

Reputation: 11711

You're linking to an example HOWTO from the websocket-4173-2 branch. Obviously, that branch contains WebSockets code. On the other hand, Twisted trunk or any released versions do not.

Read http://twistedmatrix.com/trac/ticket/4173 for more details on how it's progressing. To work with the development code, you could just checkout the aforementioned branch with svn.

Upvotes: 7

Related Questions