Reputation: 1
I've got a problem with websocket-client. That's my code:
import websocket
socket= "wss://stream.binance.com:9443/ws/ethusdt@kline_1m"
def on_open():
print("opened session")
def on_close():
print("closed session")
def on_message():
print("recived message")
ws = websocket.WebsocketApp(socket, on_open=on_open, on_close=on_close, on_message=on_message)
ws.run_forever()
And the output is
Traceback (most recent call last):
File "c:\Users\konta\OneDrive\Pulpit\cryptobot\bot.py", line 15, in <module>
ws = websocket.WebsocketApp(socket, on_open=on_open, on_close=on_close, on_message=on_message)
AttributeError: module 'websocket' has no attribute 'WebsocketApp'
Everywhere the ones asking questions were told to uninstall websocket-client and just websocket, but I have tried that on many projects. I've even tried downloading and installing wheel from my desktop and I have no clue how to solve it, could you help, or just suggest what can i try?
Upvotes: 0
Views: 640
Reputation: 11
instead of
ws = websocket.WebsocketApp
replace this line of code by
ws = websocket.WebSocketApp(...)
Upvotes: 1