-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error message at broker import #47
Comments
so how can you know whether the ib_broker file is not there or the dependencies are not there? you want to execute a file exist check, read all imports in the beginning if the file is there and try to import the dependencies in the broker file? Or maybe make people install snakefood? pip install snakefood sfood-imports ib_broker.py generates: /usr/local/lib/python2.7/dist-packages/zipline/gens/brokers/ib_broker.py:14: sys |
I think we can simply catch ImportError, and then check if the module exists (via pkgutil, to avoid external dependencies) we can print an error about missing dependencies. you can find usage of pkgutil in here: https://github.com/zipline-live/zipline/pull/63/files |
The brokers are dynamically imported in zipline-live based on the value of --broker command line parameter. If a nonexistent broker is specified an error is presented to the user:
zipline/zipline/__main__.py
Lines 240 to 245 in 0da1969
The following error is also presented if the broker is supported, but its dependencies are not present. We should improve the error message in that case and notify the user about the dependency problem.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: