Default websocket code not working!

dummydost
dummydost edited October 2016 in Python client
When I run the following default code,

#! /usr/bin/python3.5
from kiteconnect import WebSocket

kws = WebSocket(api_key, public_token, user_id)


def on_tick(tick, ws):
print(tick)

def on_connect(ws):
ws.subscribe([738561, 5633])
ws.set_mode(ws.MODE_FULL, [738561])


kws.on_tick = on_tick
kws.on_connect = on_connect

kws.connect()


it throws the following error:

Traceback (most recent call last):
File "./websocket.py", line 2, in <module>
from kiteconnect import WebSocket
File "/usr/local/lib/python3.5/dist-packages/kiteconnect/__init__.py", line 97, in <module>
import websocket
File "/home/chanzerre/websocket.py", line 2, in <module>
from kiteconnect import WebSocket
ImportError: cannot import name 'WebSocket'



I don't know how to deal with this. Can someone help me out here?

Thanks!
This discussion has been closed.