wrighter / ib-scripts

Python scripts that use the Interactive Brokers TWS API
MIT License
48 stars 19 forks source link

Warning: This script does not work with IBPy versions below 10: 9.81.1-1 #11

Closed alphaDev23 closed 1 year ago

alphaDev23 commented 1 year ago

I'm running IB Trader Workstation, Build 10.21.1r, Mar 17, 2023 11:07:15 AM, which should contain the latest TWS API. However, when attempting to download data, './src/download_bars.py -p 7497 --size "1 min" --start-date 20200202 --end-date 20200207 AMGN', I receive:

Warning: This script does not work with IBPy versions below 10: 9.81.1-1 Please upgrade to version 10 of IBPy, you can download it from https://interactivebrokers.github.io.

The instructions provided via https://ibkr.info/article/2484 to install the api on linux only describe how to download the api. I did install the python version of the api but when executing 'import lbapi', I receive: import-im6.q16: attempt to perform an operation not allowed by the security policy PS' @ error/module.c/OpenModule/1285. import-im6.q16: no encode delegate for this image formatPS' @ error/constitute.c/WriteImage/1237.

However, I don't believe the python version is needed because the API appears to be included in TWS itself.

How do I fix?

wrighter commented 1 year ago

You're running 9.81.1-1 of the IB python api. I wrote this article a while back on how to install the API. Your Trader Workstation and the IB API are two different things. So to fix this, you need to download a 10.x version of the API and install it in your python environment.

Your error message about running the import command makes me think you're running import in your shell, not in a Python session. (that error message is coming from the import command in ImageMagick, I believe)

alphaDev23 commented 1 year ago

Thank you for the quick responses on both of the issues. I re-read your page and discovered what I overlook. Your scripts and instructions are masterful. It is now working as expected. Thank you.