Closed gringo29 closed 6 years ago
@Fitblip same issue over here on a freshly installed Ubuntu 16.04 machine
Not able to find the OPEN class in websockets.protocol source code either.
>>> from websockets.protocol.
websockets.protocol.CTRL_OPCODES websockets.protocol.__doc__ websockets.protocol.__spec__
websockets.protocol.ConnectionClosed( websockets.protocol.__eq__( websockets.protocol.__str__(
websockets.protocol.DATA_OPCODES websockets.protocol.__file__ websockets.protocol.__subclasshook__(
websockets.protocol.Frame( websockets.protocol.__format__( websockets.protocol.asyncio
websockets.protocol.InvalidState( websockets.protocol.__ge__( websockets.protocol.asyncio_ensure_future(
websockets.protocol.OP_BINARY websockets.protocol.__getattribute__( websockets.protocol.build_request(
websockets.protocol.OP_CLOSE websockets.protocol.__gt__( websockets.protocol.build_response(
websockets.protocol.OP_CONT websockets.protocol.__hash__( websockets.protocol.check_request(
websockets.protocol.OP_PING websockets.protocol.__init__( websockets.protocol.check_response(
websockets.protocol.OP_PONG websockets.protocol.__le__( websockets.protocol.codecs
websockets.protocol.OP_TEXT websockets.protocol.__loader__ websockets.protocol.collections
websockets.protocol.PayloadTooBig( websockets.protocol.__lt__( websockets.protocol.encode_data(
websockets.protocol.State( websockets.protocol.__name__ websockets.protocol.enum
websockets.protocol.WebSocketCommonProtocol( websockets.protocol.__ne__( websockets.protocol.logger
websockets.protocol.WebSocketProtocolError( websockets.protocol.__new__( websockets.protocol.logging
websockets.protocol.__all__ websockets.protocol.__package__ websockets.protocol.parse_close(
websockets.protocol.__cached__ websockets.protocol.__reduce__( websockets.protocol.random
websockets.protocol.__class__( websockets.protocol.__reduce_ex__( websockets.protocol.serialize_close(
websockets.protocol.__delattr__( websockets.protocol.__repr__( websockets.protocol.struct
websockets.protocol.__dict__ websockets.protocol.__setattr__(
websockets.protocol.__dir__( websockets.protocol.__sizeof__(
>>> from websockets.protocol.```
Hey folks,
This is because you have the wrong version of the websockets
library installed - you should install version 3.4 (which is pinned in the requirements.txt
file).
If you do a pip3 install websockets==3.4
things should work just fine.
Even better, if you feel like submitting a PR to fix this so it runs with the most recent version that'd be neat!
@Fitblip : Do you have a chance to review #8? All tests passed from my side, thanks!
Yep, huge thanks @abawchen! Merging now and closing this.
After I did install wsstat using pip3, and when I tried to run it, I got the following:
wsstat Traceback (most recent call last): File "/bin/wsstat", line 7, in
from wsstat.main import wsstat_console
File "/usr/lib/python3.4/site-packages/wsstat/main.py", line 5, in
from wsstat.clients import WebsocketTestingClient
File "/usr/lib/python3.4/site-packages/wsstat/clients.py", line 16, in
from websockets.protocol import OPEN
ImportError: cannot import name 'OPEN'
Could you please help me with that?
pip3.4 list DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. asyncio (3.4.3) attrs (17.4.0) pip (9.0.1) pluggy (0.6.0) py (1.5.2) pytest (3.3.2) setuptools (38.4.0) six (1.11.0) urwid (2.0.1) websockets (4.0.1) wheel (0.30.0) wsstat (1.2.1)
python -V Python 3.4.5
Thanks in advance. Regards.