erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.81k stars 754 forks source link

ib_insync and import issues (python 3.7) #100

Closed micheloosterhof closed 6 years ago

micheloosterhof commented 6 years ago

Hello! I'm running ib_insync with Python 3.7 and Jupyter Notebooks through an IB gateway.

I have some issues with the import statements for ib_insync and I'm wondering if it has anything to do with Python 3.7. I've installed ib_insync in my local site-packages with setup.py

I can successfully import submodules like ib_insync.util, but importing the module as a whole, or using from ib_insync import * fails for unclear reasons to me. I think it may have something to do with the code in __init__.py that tries to load the additional modules. There are no clear error messages, the import statement executes but the modules are not loaded.

When I clear out __init__.py and have an empty file here, I have managed to make ib_insync work, but I'd rather not make local modifications.

micheloosterhof commented 6 years ago

Seems to work now, must have been a glitch in Jupiter.

erdewit commented 6 years ago

This could happen if there's a python file in the search path with the same name as the module (in this case ib_insync.py)