ibapi - Unresolved reference - sources root not working

Attemping to set a source root within Pycharm. It's not seeing the modules in the specified source folder.

As you can see from the attached, the ibapi directory is set as a sources root. The files are present, yet the import statements are throwing an Unresolved reference error.

I am able to resolve this by actually installing the ibapi package (through the blue link below, or Python Interpreter menu)

...but this is irritating me; I want to use and modify the classes locally.

Can anyone shed some light? Everything seems to be in order. Thx, Keith :^)
 

Attachments

  • pycharm_unresolved_reference.png
    pycharm_unresolved_reference.png
    90.8 KB · Views: 24
Last edited:
Aargh I got it. I was double-referencing "ibapi." I needed to set the source root as simply:

Code:
C:/TWS API/source/pythonclient
 
PyCharm is a great choice.

You may want to include the Anaconda package manager. The first install includes everything but the kitchen sink. However, library updates become easier as you expand your tool set.

They offer all the widely used libraries and versions with a simple syntax on the command line such as:

conda install -c anaconda seaborn
 
PyCharm is a great choice.

You may want to include the Anaconda package manager. The first install includes everything but the kitchen sink. However, library updates become easier as you expand your tool set.

They offer all the widely used libraries and versions with a simple syntax on the command line such as:

conda install -c anaconda seaborn
Thanks I'm using virtualenv venv within PyCharm. It's integrated (as well as conda and pipenv).

I prefer virtualenv simply because I used it a lot in my last job, and know my way around.

Also, although it's available as a package, I don't really want to install ibapi as a package. I want to clone the repo and use local source files, because I may need to modify some of the IB classes and even pull request some stuff. I like the bleeding edge XD.
 

Attachments

  • pycharm_env.png
    pycharm_env.png
    35.7 KB · Views: 11
Last edited:
Back
Top