Fitblip / wsstat

Websocket stress testing made beautiful
MIT License
173 stars 24 forks source link

ModuleNotFoundError: No module named 'websockets.handshake' #20

Open pthreat opened 3 years ago

pthreat commented 3 years ago

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

rldiao commented 3 years ago

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

inihility commented 3 years ago

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?

rldiao commented 3 years ago

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

alzalabany commented 3 years ago

same here on python 3.8 macOS

joshelb commented 2 years ago

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

Jerczey commented 2 years ago

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:

macielportugal commented 1 year ago

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