I have 2FA enabled on my IBKR account. When I try to connect QuantRocket to IBKR using the jupyter notebook, it always fails.
from quantrocket.ibg import set_credentials
set_credentials("ibg1", username="username", trading_mode="live or paper")
When I execute the above, if IB gateway is running, I get an error:
{'status': 'error', 'msg': 'please stop IB Gateway before setting credentials (current status is: error)'})
When I stop the IB gateway, the cell hangs for a while, I receive a 2FA notification and then it fails.
For the live account, I am able to bypass this problem by directly using IB Gateway GUI to connect to IBKR. For the paper account, I am not able to use the same way. I see the error in the screenshot, when I try to login to the paper account on IB Gateway GUI.
Need help to resolve the login issue with the paper account (more important at the moment) and live account.