BitMEX / api-connectors

Libraries for connecting to the BitMEX API.
https://www.bitmex.com/app/restAPI
909 stars 797 forks source link

Error : name 'opcode' is not defined #79

Closed nuts577 closed 6 years ago

nuts577 commented 6 years ago

Hello,

Running main.py in Python 3.5.2, changed to "https://www.bitmex.com/", create and set API keys for www.bitmex.com and getting

`C:\Users\Administrator\Downloads>main.py 2018-02-01 12:48:55,606 - bitmex_websocket - INFO - Connecting to wss://www.bitm ex.com/realtime?subscribe=execution:XBTUSD,instrument:XBTUSD,order:XBTUSD,orderB ookL2:XBTUSD,position:XBTUSD,quote:XBTUSD,trade:XBTUSD,margin 2018-02-01 12:48:55,606 - bitmex_websocket - INFO - Authenticating with API Key.

2018-02-01 12:48:57,327 - bitmex_websocket - ERROR - Error : name 'opcode' is no t defined 2018-02-01 12:48:57,420 - bitmex_websocket - INFO - Websocket Closed 2018-02-01 12:49:00,642 - bitmex_websocket - ERROR - Couldn't connect to WS! Exi ting.`

What I'm doing wrong?

ryanfox commented 6 years ago

This looks like an issue with the websocket-client library. What version of that do you have installed?

nuts577 commented 6 years ago

Thanks very much! websocket-client version was 0.39.0, updated to 0.46.0 and it works perfectly.