Hi Trendal,
> I'm in a terrible pinch here. I have autobahn working flawlessly on
> my development server (ubuntu 14.04) and I needed to move it to the
> live server (12.04 ubuntu) today but it fails with a couple things I
> can't figure out. I know this is nobody's problem but mine, but
> this is supposed to be operating today.
Most likely you are using a different version of Autobahn on your dev
machine. Pls see below ..
>
> When trying to run the code I get first a warning then an error
>
> UserWarning: Module twisted was already imported from
> /usr/lib/python2.7/dist-packages/twisted/__init__.pyc, but
> /usr/local/lib/python2.7/dist-packages/autobahn-0.9.0-py2.7.egg is
> being added to sys.path
>
> Traceback (most recent call last):
> File "websocket_server.py", line 10, in <module>
> from autobahn.websocket import listenWS
> ImportError: cannot import name listenWS
>
> Here is the code
>
> #!/usr/bin/python
>
> import sys
> from twisted.python import log
> from twisted.internet import reactor
> from twisted.web.server import Site
> from twisted.web.static import File
> from autobahn.websocket import listenWS
> from autobahn.wamp import WampServerFactory, \
> WampServerProtocol
> class PubSubServer1(WampServerProtocol):
> def onSessionOpen(self):
The code seem to be written for an very old version of Autobahn ..
probably 0.5.x, since it is WAMP v1 code, and since it is importing the
WAMP v1 classes from autobahn.wamp, not autobahn.wamp1.
You have these options:
1) install the exact same Autobahn on your server as your dev host
2) use Autobahn 0.8.15 (
https://pypi.python.org/pypi/autobahn/0.8.15).
this is the last version of Autobahn with WAMP1, but you will need to
change your import statements
3) upgrade your code to WAMP v2. Then you can use Autobahn 0.9 and later
Hope this helps (pls let me know if not) ..
/Tobias