import websocket
websocket.enableTrace(True)
ws = websocket.WebSocketApp("wss://stream.binance.com:9443/ws/!ticker@arr",
on_message = on_message,
on_error = on_error,
on_close = on_close)
源代码如上,报错:
module 'websocket' has no attribute 'enableTrace'
解决方案:
pip install websocket
-
client
这个才是正确的websocket库