stefan-jansen / machine-learning-for-trading

Code for Machine Learning for Algorithmic Trading, 2nd edition.
https://ml4trading.io
13.52k stars 4.26k forks source link

Zipline ingest Issues #293

Closed BirdyLiu6471023 closed 1 year ago

BirdyLiu6471023 commented 1 year ago

I don't understand the steps for backtesting and the environment confuse me:

In command, after I entered $zipline ingest -b quandl, I got following error:

Traceback (most recent call last): File "/opt/anaconda3/bin/zipline", line 8, in sys.exit(main()) File "/opt/anaconda3/lib/python3.8/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/opt/anaconda3/lib/python3.8/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/opt/anaconda3/lib/python3.8/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/opt/anaconda3/lib/python3.8/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/opt/anaconda3/lib/python3.8/site-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) File "/opt/anaconda3/lib/python3.8/site-packages/zipline/main.py", line 397, in ingest bundles_module.ingest( File "/opt/anaconda3/lib/python3.8/site-packages/zipline/data/bundles/core.py", line 424, in ingest asset_db_writer = AssetDBWriter(assets_db_path) File "/opt/anaconda3/lib/python3.8/site-packages/zipline/assets/asset_writer.py", line 3, in init # File "/opt/anaconda3/lib/python3.8/site-packages/zipline/utils/input_validation.py", line 811, in preprocessor return to(arg, to_kwargs) File "/opt/anaconda3/lib/python3.8/site-packages/zipline/utils/sqlite_utils.py", line 45, in check_and_create_engine return sa.create_engine("sqlite:///" + path, future=False) File "", line 2, in create_engine File "/opt/anaconda3/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py", line 281, in warned return fn(*args, **kwargs) # type: ignore[no-any-return] File "/opt/anaconda3/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 662, in create_engine raise exc.ArgumentError( sqlalchemy.exc.ArgumentError: The 'future' parameter passed to create_engine() may only be set to True.

I have no idea what should I do. There is no same ERROR in the stack overflow. I don't know how to solve it : ( I am waiting for your solution. Thanks!

stefan-jansen commented 1 year ago

Looks like you may have used SQLAlchemy 2.0, which is only supported by the recently released new version of Zipline: https://zipline.ml4trading.io/install.html. Please try again and feel free to reopen this issue if the problem persisits.