ibapi - Unresolved reference - sources root not working

Discussion in 'Interactive Brokers' started by kmiklas, Aug 2, 2021.

  1. kmiklas

    kmiklas

    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 :^)
     
    Last edited: Aug 2, 2021
  2. kmiklas

    kmiklas

    Aargh I got it. I was double-referencing "ibapi." I needed to set the source root as simply:

    Code:
    C:/TWS API/source/pythonclient
    
     
  3. xandman

    xandman

    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
     
  4. kmiklas

    kmiklas

    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.
     
    Last edited: Aug 3, 2021
    xandman likes this.