Attribute Error Question
I keep getting this error when using backtrader:
AttributeError: module 'backtrader.stores' has no attribute 'IBStore'
I'm on a macbook pro running python 3.6 through Spyder (via anaconda). I have backtrader and IbPy2 installed and I am not sure what may be happening. Any tips? It happens when I try to run this code: https://gist.github.com/backtrader/456cf0891a7a62ceb2bbb5e4234c01e7
through Spyder (via anaconda)
That's usually the bullet that shoots yourself in the foot. You probably installed things in the shell and are not found by those hijacking environments. Run a 1-line script with "import ib". If it fails it is because
IbPyis not found.
Run from the shell.
fugaz last edited by
Hello @xbitech and community
Did you solve the issue? And how?
I'm having the same issue and I struggle with finding the cause
Python 3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ib >>> import backtrader as bt >>> ibstore = bt.stores.IBStore(host='127.0.0.1', port=4002, clientId=35) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'backtrader.stores' has no attribute 'IBStore' >>>
fugaz last edited by
FWIW, and to help those coming from Google.
Issue for me was with ib package. It seems that the pip install is broken or doesn't (always?) work properly, as found here
I managed to have the module working by installing it from sources
The Github repository (https://github.com/blampe/IbPy) says:
pip install IbPy2
The backtrader docs prefer installation directly from the repository (which is like installing from the sources, but without having to download the package yourself)
pip install git+https://github.com/blampe/IbPy.git
You installation method seems to be for this other package
which was released on Jun 13, 2013 and seems to have never been done by the maintainers of
Tejas Krishna Reddy last edited by
I had the same error that went away after I installed IbPy2. But just another trivial point that I missed is that, do restart your kernel in any python platform you are working on, after pip installing IbPy2. Or else it keeps throwing the same error haha.
run-out last edited by