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:

  1. I installed the latest version for Windows from here
  2. I provided the following path to the PYTHONPATH manager in Spyder: C:\TWS API\source\pythonclient\ibapi afterwards I restarted Spyder

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

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

Newskooler
  • 3,973
  • 7
  • 46
  • 84

3 Answers3

14

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 API\source\pythonclient and run 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.

brian
  • 10,619
  • 4
  • 21
  • 79
2

Note: after python setup.py install, you might need to restart spyder. If doesn't help, then copy the newly-created ibapi folder to:

C:\Users\iuzeri\AppData\Local\Programs\Python\Python37-32\Lib\site-packages

or

C:\Program Files (x86)\Python37-32\Lib\site-packages

T.Todua
  • 53,146
  • 19
  • 236
  • 237
0

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