kevin
kevin

Reputation: 159

Python Unresolved import error with IBPY

I am new to Python, and I am using PyDev in Eclipse to practice Python, the interpreter is Python 3.5.

I am trying to develop Python code to access Interactive Brokers, simply copying the code described in the link:

https://www.quantstart.com/articles/using-python-ibpy-and-the-interactive-brokers-api-to-automate-trades

I downloaded the latest IBPY library (ib-0.8.0), and installed it using command

python setup.py install

However, I got errors at the very beginning after I copied the code

   from ib.ext.Contract import Contract
   from ib.ext.Order import Order
   from ib.opt import Connection, message

PyDev show unresolved import for Contract, Order, and Connection, message

I checked the extracted library folder for IBPY, they are all there

Can someone help me findout what is the reason?

Thanks a lot!

Upvotes: 0

Views: 378

Answers (2)

Dhruv Aggarwal
Dhruv Aggarwal

Reputation: 53

Solve the problem by running:

pip3 install ibapi 

Upvotes: 0

kevin
kevin

Reputation: 159

The problem is resolved, the IBPY source code contains errors

python setup.py install

report code syntax errors, after I correct the errors, the unresolved import problem disappear, it seems the source was corrupted

Upvotes: 0

Related Questions