Adding the ibapi library to PYTHONPATH module in Spyder (Python 3.6)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Adding the ibapi library to PYTHONPATH module in Spyder (Python 3.6)



I am trying to simply connect to the ibapi (Interactive Brokers API), but I am having some technical troubles with Spyder.



What I did so far:


C:TWS APIsourcepythonclientibapi



When I simply type import ibapi I get the same error message: ModuleNotFoundError: No module named 'ibapi'


import ibapi


ModuleNotFoundError: No module named 'ibapi'



What I am doing wrong here and how can I fix this simple error?




4 Answers
4



I don't use python very much but I'm pretty sure you have to install the ibapi. I never used the PYTHONPATH and mine works fine in Spyder and Jupyter. I'm using Anaconda.



I run the Anaconda prompt (just activates the conda environment) and navigate to the dir C:TWS APIsourcepythonclient and run python setup.py install


C:TWS APIsourcepythonclient


python setup.py install



Then everything works. I think many python packages need to be installed like this.



note: That's not my install dir, I just copied yours. There may be a problem with a space in the path. Try renaming to C:TWSAPI... if you still have a problem.


C:TWSAPI...



copy your ibapi here
C:/ProgramData/Anaconda3/Lib/site-packages/ibapi



Hi i also new to TWS Api. I tried to set the path but i cant find the Pythonclient folder in c:/TWS API/ source
there are only CppClient, CSharpCliet and JavaClient. The Python Client is missing. Someone has a solutuion for my problem?





Ok i got it. You need to download version 9.73.2
– saveit
Feb 10 at 15:25



Did you ever find a solution to this? I'm having the same error. I've installed the ibapi module from the Anaconda prompt, but when trying to import I get:
ModuleNotFoundError: No module named 'ibapi'.



I ran pip list at the Anaconda prompt, and while ibapi was in the list, the location displayed for the ibapi package seemed to be different from the rest (no location was displayed for the rest of the packages - only for ibapi)



So I checked the paths in sys.path by running the following at the prompt:
-c "import sys; print('n'.join(sys.path))"



The location stated for ibapi is in there, which is:
c:usersrobertanaconda3libsite-packagesibapi-9.73.7-py3.6.egg



So I'm not sure why I can't import.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS