AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.61k stars 2.33k forks source link

NameError: name 'config' is not defined: in Tutorial Installing FinRL via Colab #403

Closed marcipops closed 2 years ago

marcipops commented 2 years ago

I'm a beginner, so following: FinRL for Quantitative Finance: Install and Setup Tutorial for Beginners https://ai4finance.medium.com/finrl-for-quantitative-finance-install-and-setup-tutorial-for-beginners-1db80ad39159 Selected Colab option: Section 4: Google Colab Following instructions and failed at section: 4.3 Run FinRL "Google Colab has a lot of default packages which is very convenient. Just follow the steps in the FinRL notebook, you should be able to install and run FinRL."

Running FinRL_StockTrading_NeurIPS_2018.ipynb, failed at section "2.1. Install all the packages through FinRL library"

Import os if not os.path.exists("./" + config.DATA_SAVE_DIR): os.makedirs("./" + config.DATA_SAVE_DIR) if not os.path.exists("./" + config.TRAINED_MODEL_DIR): os.makedirs("./" + config.TRAINED_MODEL_DIR) if not os.path.exists("./" + config.TENSORBOARD_LOG_DIR): os.makedirs("./" + config.TENSORBOARD_LOG_DIR) if not os.path.exists("./" + config.RESULTS_DIR): os.makedirs("./" + config.RESULTS_DIR)

Error:

NameError: name 'config' is not defined

How do I resolve this please?

Thanks!

rayrui312 commented 2 years ago

Thanks for reporting it. We have updated the notebook. You may have a try and check if it solves the problem.

marcipops commented 2 years ago

thanks rayrui312 for solving this so quickly!

Yes, adding "from finrl.apps import config" solved the problem.

Many thanks and Happy New Year!

michalinahulak commented 1 year ago

I also try to install FinRL like in your colab notebook but there is error when i run this:

install finrl library

!pip install git+https://github.com/AI4Finance-LLC/FinRL-Library.git

error:

error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. Building wheel for box2d-py (setup.py) ... error ERROR: Failed building wheel for box2d-py Running setup.py clean for box2d-py Successfully built finrl elegantrl Failed to build box2d-py ERROR: Could not build wheels for box2d-py, which is required to install pyproject.toml-based projects