AttributeError: 'module' object has no attribute 'WebSocketApp'

i am getting following error while trying to get streaming data
File "C:\Users\shanthan\AppData\Local\Continuum\anaconda2\lib\site-packages\spyder\utils\site\", line 86, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/nandan/stocks/api-trading/", line 32, in

File "C:\Users\shanthan\AppData\Local\Continuum\anaconda2\lib\site-packages\kiteconnect\", line 945, in connect
self.socket = self._create_connection(self.socket_url + "?uid=" + str(time.time()))

File "C:\Users\shanthan\AppData\Local\Continuum\anaconda2\lib\site-packages\kiteconnect\", line 901, in _create_connection
return websocket.WebSocketApp(url,

AttributeError: 'module' object has no attribute 'WebSocketApp'

request help in resolving the issue
  • sujith
    I think you named your file as WebSocket which is overriding some inbuilt module. Try renaming your file.
  • iamnandans
    Hi Sujith,
    File name is and not

  • prat
    make sure you have websocket client package installed
  • iamnandans
    i Guess it websocket will get installed when kiteconnect is installed. Also, verified websocket client package is also installed.
Sign In or Register to comment.