Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pthreat opened this issue May 10, 2021 · 7 comments
Open

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

pthreat opened this issue May 10, 2021 · 7 comments

Comments

@pthreat
Copy link

pthreat commented May 10, 2021

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
Copy link

rldiao commented May 10, 2021

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
Copy link

inihility commented May 14, 2021

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
Copy link

rldiao commented Jun 1, 2021

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
Copy link

same here on python 3.8 macOS

@joshelb
Copy link

joshelb commented Oct 22, 2021

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

@Jerczey
Copy link

Jerczey commented Jul 5, 2022

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 🗡️

@macielportugal
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants