It looks like you're new here. If you want to get involved, click one of these buttons!
#! /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()
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'
pip freeze
and check if it is actually installed? This can also happen if there is a circular import.Thanks!