Python Websockets Module has no attribute

you've installed the wrong library (websocket) try installing websocket-client

$ pip install websocket-client

and then your code must work just fine


See the answer by falsetru here: AttributeError: 'module' object has no attribute 'WebSocketApp'

" Make sure that you didn't name your file as websocket.py; Otherwise, it will prevent import of the desired third-party module websocket; because your module is searched first according to sys.path module search path.

Rename your module to other name, and make sure to clean websocket.pyc if it was generated."