zipline-live / zipline

Zipline-Live, a Pythonic Algorithmic Trading Library
http://www.zipline-live.io/
Apache License 2.0
396 stars 65 forks source link

Broker Not Found Error #52

Closed eudisd closed 7 years ago

eudisd commented 7 years ago

Dear Zipline Maintainers, From the zipline-live.io tutorial:

Installation of zipline-live works fine. Downloading the quandl bundle works fine as well. However, when I try to run the zipline-live demo program, with the following command:

zipline run -f ~/zipline-algos/demo.py --broker ib --broker-uri localhost:7496:1232 --bundle quantopian-quandl  --data-frequency minute

I get an error.

Environment

Now that you know a little about me, let me tell you about the issue I am having:

Description of Issue

[box@MacBook-Pro] ~
❯ zipline run -f ~/zipline-algos/demo.py --broker ib --broker-uri localhost:7496:1232 --bundle quantopian-quandl  --data-frequency minute

Usage: zipline run [OPTIONS]

Error: unsupported broker: can't import module zipline.gens.brokers.ib_broker

Here is how you can reproduce this issue on your machine:

Reproduction Steps

1.

virtualenv ~
source ~/venv-zipline-live/bin/activate
pip install zipline-live[ib]
  1. zipline ingest -b quantopian-quandl
  2. zipline run -f ~/zipline-algos/demo.py --broker ib --broker-uri localhost:7496:1232 --bundle quantopian-quandl  --data-frequency minute

    ...

What steps have you taken to resolve this already?

N/A ...

Anything else?

N/A

tibkiss commented 7 years ago

Thanks for the detailed report.

For some reason IbPy2 is not installed in your environment. pip install zipline-live[ib] should ensure that ibpy2 as a dependency is installed.

Please make a try to run pip install IbPy2==0.8.0 inside your virtualenvironment.

Unfortunately the error message is not helpful here (unsupported broker), we have an issue opened against that: https://github.com/zipline-live/zipline/issues/47

eudisd commented 7 years ago

That did it! Thanks @tibkiss, this solved my problem. I think the problem this issue should address now is why IbPy2 is not installed when zipline-live is installed?

tibkiss commented 7 years ago

For others pip install zipline-live[ib] brings in IbPy2 as dependency, I'm not sure why did not bring it in for you. Could you please check and make sure you run that command?

In some shells (such as zsh) the zipline-live[ib] part should be quoted to properly pass the profile inside the braces: pip install "zipline-live[ib]"

eudisd commented 7 years ago

yup thats it i believe. i use zsh which caused the issue. thanks for the help, closing this issue