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

iamnandans
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\sitecustomize.py", line 86, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/nandan/stocks/api-trading/streamdata.py", line 32, in
kws.connect()

File "C:\Users\shanthan\AppData\Local\Continuum\anaconda2\lib\site-packages\kiteconnect\__init__.py", 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\__init__.py", 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 streamdata.py and not websocket.py

    Regards,
    Nandan
  • 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.