5

I have installed twisted and Autobahn websocket by using

pip install twisted
pip install autobahn

But when I import any of the factories from Autobahn, I get the cannot import name error.

    >>> from twisted.internet import reactor
    >>> from autobahn.websocket import WebSocketClientFactory
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
    ImportError: cannot import name WebSocketClientFactory

Is there anything I am missing? Here's the pip freeze

Twisted==13.2.0
Twisted-Core==12.3.0
Twisted-Names==12.3.0
Twisted-Web==12.3.0
autobahn==0.7.4
websocket==0.2.1
websocket-client==0.13.0
crazydiv
  • 812
  • 9
  • 30

1 Answers1

6

It looks as thoough WebSocketClientFactory is in twisted sub-module:

from autobahn.twisted.websocket import WebSocketClientFactory

tayfun
  • 3,065
  • 1
  • 19
  • 23
  • My code was using 0.6.5 earlier which was working fine. First thing I should have done is to look into my site-package to see if something has changed. Thanks! – crazydiv Jan 27 '14 at 13:16
  • The package has moved with 0.7.0 (since Autobahn|Python now supports both Twisted and asyncio). Please see: https://github.com/tavendo/AutobahnPython#upgrading-from-autobahn--070 – oberstet Jan 27 '14 at 13:55