wsstat icon indicating copy to clipboard operation
wsstat copied to clipboard

ModuleNotFoundError: No module named 'websockets.handshake'

Open pthreat opened this issue 3 years ago • 7 comments

Traceback (most recent call last): File "/usr/local/bin/wsstat", line 7, in from wsstat.main import wsstat_console File "/usr/local/lib/python3.6/dist-packages/wsstat/main.py", line 5, in from wsstat.clients import WebsocketTestingClient File "/usr/local/lib/python3.6/dist-packages/wsstat/clients.py", line 14, in import websockets.handshake

pthreat avatar May 10 '21 20:05 pthreat

Seems like this project doesnt support python 3.6. Ive tested it in 3.8 and had the same error. Retested it in 3.5 and it worked

rldiao avatar May 10 '21 23:05 rldiao

I'm on 3.5 and instead of the websockets.handshake error I get this:

Traceback (most recent call last):
  File "z:\anaconda3\envs\websocket\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "z:\anaconda3\envs\websocket\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "Z:\anaconda3\envs\websocket\Scripts\wsstat.exe\__main__.py", line 4, in <module>
  File "z:\anaconda3\envs\websocket\lib\site-packages\wsstat\main.py", line 5, in <module>
    from wsstat.clients import WebsocketTestingClient
  File "z:\anaconda3\envs\websocket\lib\site-packages\wsstat\clients.py", line 13, in <module>
    import websockets
  File "z:\anaconda3\envs\websocket\lib\site-packages\websockets\__init__.py", line 1, in <module>
    from .imports import lazy_import
  File "z:\anaconda3\envs\websocket\lib\site-packages\websockets\imports.py", line 90
    f"{package}.{name} is deprecated",
                                    ^
SyntaxError: invalid syntax

Any ideas?

inihility avatar May 14 '21 07:05 inihility

The error was caused by F-string being invalid syntax. Seems like one of the dependencies is probably too high a version. Make sure you're using virtual environments. Something like this https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/20/conda/ for anaconda

rldiao avatar Jun 01 '21 12:06 rldiao

same here on python 3.8 macOS

alzalabany avatar Aug 30 '21 13:08 alzalabany

you have to change the sourcecode to import websockets.legacy.handshake

joshelb avatar Oct 22 '21 14:10 joshelb

this is happening on fedora 33 as well with Python 3.9.9 I just wanted to try this cool app with my quickstart websocket :dagger:

Jerczey avatar Jul 05 '22 20:07 Jerczey

File "/usr/local/lib/python3.6/dist-packages/wsstat/clients.py", line 14, in import websockets.legacy.handshake

there are many things to update beyond that

macielportugal avatar Jul 26 '23 20:07 macielportugal