quantrocket-llc/ibpythonic

API version 9.74 AttributeError

jakezimmerman22 opened this issue · 5 comments

I have only seen this with API version 9.74. Below is the first half of the quickstart provided. Imports are fine. The error occurs when trying to connect...

from ibpythonic import ibConnection, message
from ibapi.contract import Contract

def contractDetailsHandler(msg):
print(msg.contractDetails)
# do something with contractDetails msg

def errorHandler(msg):
print(msg)

conn = ibConnection(port=4001, clientId=100) --> ERROR

Traceback (most recent call last):
File "C:/TWS API/source/pythonclient/pythonic_test.py", line 11, in
conn = ibConnection(port=4001, clientId=100)
File "C:\Users\Scott\AppData\Local\Programs\Python\Python37\lib\site-packages\ibpythonic\connection.py", line 88, in create
receiver = Receiver(dispatcher) if receiver is None else receiver
File "C:\Users\Scott\AppData\Local\Programs\Python\Python37\lib\site-packages\ibpythonic\receiver.py", line 26, in dispatchMethod
self.dispatcher(name, dict(list(zip(parameters, arguments))))
AttributeError: 'Receiver' object has no attribute 'dispatcher'

Exactly the same error here. Logging in 9.74 seems to be very different, which is most likely the cause.

QuantRocket is currently pinned to 9.73 so haven't encountered this error yet. Will look at it when I get a moment.

IB added an __init__ method to the EWrapper class which caused a name collision. This is fixed in 0.1.5:

pip install -U ibpythonic

Much appreciated.