github_url: | https://github.com/AI4Finance-Foundation/FinRL |
---|
Step 1: Install Anaconda
-Download Anaconda Installer, Anaconda has everything you need for Python programming.
-Follow Anaconda’s instruction: macOS graphical install, to install the newest version of Anaconda.
-Open your terminal and type: 'which python', it should show:
/Users/your_user_name/opt/anaconda3/bin/python
It means that your Python interpreter path has been pinned to Anaconda’s python version. If it shows something like this:
/Users/your_user_name/opt/anaconda3/bin/python
It means that you still use the default python path, you either fix it and pin it to the anaconda path (try this blog), or you can use Anaconda Navigator to open a terminal manually.
Step 2: Install Homebrew
-Open a terminal and make sure that you have installed Anaconda.
-Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 3: Install OpenAI
Installation of system packages on Mac requires Homebrew. With Homebrew installed, run the following in your terminal:
brew install cmake openmpi
Step 4: Install FinRL
Since we are still actively updating the FinRL repository, please install the unstable development version of FinRL using pip:
pip install git+https://github.com/AI4Finance-Foundation/FinRL.git
Users can try:
brew install swig
pip install box2d-py
pip install box2d
pip install Box2D
If it raises errors "AttributeError: module '_Box2D' has no attribute 'RAND_LIMIT_swigconstant' ", users can try:
pip install box2d box2d-kengz
Step 6: Run FinRL
Download the FinRL-Tutorials repository either use terminal:
git clone https://github.com/AI4Finance-Foundation/FinRL-Tutorials.git
or download it manually
Open Jupyter Notebook through Anaconda Navigator and locate one of the stock trading notebook in FinRL-Tutorials you just downloaded. You should be able to run it.
Step 1: Install Anaconda
Please follow the steps in this blog
Step 2: Install OpenAI
Open an ubuntu terminal and type:
sudo apt-get update && sudo apt-get install cmake libopenmpi-dev python3-dev zlib1g-dev libgl1-mesa-glx swig
Step 3: Install FinRL
Since we are still actively updating the FinRL repository, please install the unstable development version of FinRL using pip:
pip install git+https://github.com/AI4Finance-Foundation/FinRL.git
Step 5: Run FinRL
Download the FinRL repository in terminal:
git clone https://github.com/AI4Finance-Foundation/FinRL.git
Open Jupyter Notebook by typing 'jupyter notebook' in your ubuntu terminal.
Locate one of the stock trading notebook in FinRL/tutorials you just downloaded. You should be able to run it.
- VPN is needed if using YahooFinance in china (pyfolio, elegantRL pip dependencies need pull code, YahooFinance has stopped the service in china). Othewise, please ignore it.
- python version >=3.7
- pip remove zipline, if your system has installed zipline, zipline has conflicts with the FinRL.
Step 1: Clone FinRL
git clone https://github.com/AI4Finance-Foundation/FinRL.git
cd FinRL
pip install .
python Stock_NeurIPS2018.py
If the following outputs appear, take it easy, since installation is still successful.
- UserWarning: Module "zipline.assets" not found; multipliers will not be applied to position notionals. Module "zipline.assets" not found; multipliers will not be applied'
If following outputs appear, please ensure that VPN helps to access the YahooFinance
- Failed download: xxxx: No data found for this date range, the stock may be delisted, or the value is missing.
Please check this video for detailed steps:
Step 2: Install Anaconda
Please follow the steps in this blog
Step 3: Install OpenAI
Open an ubuntu terminal and type:
sudo apt-get update && sudo apt-get install cmake libopenmpi-dev python3-dev zlib1g-dev libgl1-mesa-glx swig
Step 4: Install FinRL
Since we are still actively updating the FinRL repository, please install the unstable development version of FinRL using pip:
pip install git+https://github.com/AI4Finance-Foundation/FinRL.git
Step 6: Run FinRL
Download the FinRL-Tutorials repository in terminal:
git clone https://github.com/AI4Finance-Foundation/FinRL-Tutorials.git
Open Jupyter Notebook by typing 'jupyter notebook' in your ubuntu terminal. Please see jupyter notebook
Locate one of the stock trading notebook in FinRL-Tutorials you just downloaded. You should be able to run it.