The version of Python matches the version of IBridgePy (11), and I uninstalled Python 12. I opened Spyder with Anaconda using a Python 11 environment. I got the error from the RUN_ME.py file: ModuleNotFoundError: No module named ‘pandas’. In moving_average_crossover.py, I got 6 Undefined name errors.
It seems that your local environment does not seem to have pandas installed. In Spyder, you could try the following command: !pip install pandas
This should help. Ideally installing IBridgePy correctly should help with the error. Can you help us provide more details on the undefined name errors
I got *** Unknown command ‘pip’.
The other errors were Undefined name ‘symbol’, Undefined name ‘get_datetime’, Undefined name ‘order_target_percent’, Undefined name ‘order_status_monitor’, Undefined name ‘order_target_percent’, and Undefined name ‘order_status_monitor’.
Hi,
We are sorry you are facing these issues. Can you use the command “conda install pandas” (without the quotation marks) in the anaconda prompt. This should work. And for pip command, " python -m ensurepip --upgrade".
Can you confirm if IBridgePy is correctly installed in the system. You can check the documentation here: Tutorial: install IBridgePy and run an examples -
I really hope this helps.
Thanks.
Thanks.
I tried it in base (root) and pandas was installed. It looks like I installed IBridgePy correctly. I installed IBridgePy again and had the same 6 errors. I tried pip show ibridgepy in terminal and got WARNING: Package(s) not found: ibridgepy.
Hi Joseph,
Can you please share on which operating system are you trying to run this, system configuration details and also the steps that you followed. It would help us debug the cause of the error.
Windows 11 Pro
Intel(R) Core™ Ultra 7 155U 2.10 GHz
32.0 GB (31.6 GB usable)
I installed the latest version of IBridgePy from the website, opened Spyder and the files, and ran the files.
I uninstalled Anaconda and Miniconda and installed and updated Anaconda and created a Python 3.11 environment and got ModuleNotFoundError: No module named ‘pandas’ for RUN_ME.py and the same 6 errors and Reloaded modules: IBridgePy for moving_average_crossover.py. With base (root) I got ImportError: DLL load failed while importing IBCpp: The specified module could not be found for RUN_ME.py and the same 6 errors and Reloaded modules: IBridgePy, BasicPyLib, BasicPyLib.BasicTools, Config, IBridgePy.constants, Config.base_settings for moving_average_crossover.py.
I am using Interactive Brokers Trader Workstation (TWS) and made the changes called for in Automated Trading with IBridgePy using Interactive Brokers Platform.
If you need additional system configuration details, can you tell me what they are specifically?
Thanks
Hi Joseph,
I followed the steps as shown in the following videos to setup IBridgePy on my system and run the file and was able to do it successfully. I would suggest you to follow them once and let us know if you still face the issue. Also, it would be helpful for us to debug the issue if you could share the error log for the errors that you are getting.
I uninstalled Anaconda, deleted the IBridgePy folders, and uninstalled Trader Workstation and TWS API. I followed the first video. I’m at the point of downloading IBridgePy. Which version should I download?
Thanks
You can download the IBridgePy version based on the Anaconda Python version on your system. You can see the Anaconda Python version in the “Console” tab of Spyder.
I installed IBridgePy Python 3.11. On %run RUN_ME.py, I got:
ImportError Traceback (most recent call last)
File ~\Downloads\IBridgePy_Win_Anaconda311_64 (2)\RUN_ME.py:16
1 # -- coding: utf-8 --
2 “”"
3 There is a risk of loss when trading stocks, futures, forex, options and other
4 financial instruments. Please trade with capital you can afford to
(…)
14 All rights reserved.
15 “”"
—> 16 from configuration import run_me
18 fileName = ‘example_show_positions.py’
19 # fileName = ‘example_get_historical_data.py’
20 # fileName = ‘example_show_real_time_prices.py’
21 # fileName = ‘example_place_order.py’
(…)
41
42 # !!! IMPORTANT !!!
File ~\Downloads\IBridgePy_Win_Anaconda311_64 (2)\configuration.py:8
5 import logging
7 # noinspection PyUnresolvedReferences
----> 8 from IBridgePy.IbridgepyTools import superSymbol, check_user_sys_compatibility
9 check_user_sys_compatibility()
11 # noinspection PyUnresolvedReferences
File ~\Downloads\IBridgePy_Win_Anaconda311_64 (2)\IBridgePy\IbridgepyTools.py:32
30 from Config.base_settings import PROJECT, BROKER_CLIENT
31 # noinspection PyUnresolvedReferences
—> 32 from IBridgePy import IBCpp
33 from IBridgePy.OrderTypes import OrderStyle
34 from IBridgePy.constants import SymbolStatus, ExchangeName
ImportError: DLL load failed while importing IBCpp: The specified module could not be found.
Thanks
Hi Joseph,
You can refer to this Q&A present on the IBridgePy website for resolving the above error. If the issue persists, I recommend trying the Docker version of IBridgePy. Alternatively, you can contact the IBridgePy team at IBridgePy@gmail.com with the error details for further assistance.
I got in touch with IBridgePy@gmail.com and tried again and it worked! Thanks for all your help.
Best,
Joe