Technical requirements
This book relies on the Anaconda distribution of Python. We’ll use Jupyter Notebook and Python script files to write the code. Unless specified otherwise, all the code can be written in Jupyter Notebooks.
Download and install the Anaconda distribution of Python. You can do this by going to https://www.anaconda.com/download. Depending on your operating system, the instructions for downloading and installing will vary. Please refer to the Anaconda documentation for detailed instructions.
Anaconda ships with a package manager called conda
. Package managers make it easy to install, remove, and update Python packages. There’s a great cheat sheet for the conda
package manager that you can download from https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf.
Once you’ve installed the Anaconda distribution, open your Terminal on Mac or Linux or the Anaconda Prompt on Windows. If you’re a Windows user, make sure to use the Command Prompt instead of the Powershell prompt. Then follow these steps:
- Update the
conda
package manager:conda update -n base conda -y
- Create a virtual environment:
conda create -n my-quant-stack python=3.10 -y
- After the installation process is complete, activate the environment:
conda activate my-quant-stack
- Install Jupyter Notebook using the package manager that ships with Python,
pip
:pip install notebook matplotlib
This will set up a virtual environment using Python 3.10 and install Jupyter Notebook.
This chapter will use Two Python libraries to acquire financial market data: the OpenBB Platform and pandas_datareader
. The good news is that installing the OpenBB Platform installs many of the libraries you will need to acquire financial market data, including pandas_datareader
. As such, there is no need to install the libraries separately.
Install the OpenBB Platform with all extensions and providers (both officially supported and community-maintained ones) using pip
:
pip install openbb[all]
This is the easiest way to set up the OpenBB Platform for this book.
Important note
In a macOS zsh Terminal shell, add quotation marks around the library name: "openbb[all]"
To install a single extension:
pip install openbb[charting] pip install openbb[ta]
Or install a single provider:
pip install openbb[yfinance]
To install the Nightly distribution (this installs all extras by default):
pip install openbb-nightly
Important note
At the time of writing, installing the OpenBB Platform using pip
isn’t compatible with environments such as Google Colab and Kaggle since they come with preinstalled packages that can conflict with the ones used with the OpenBB Platform. If you run into trouble installing the OpenBB Platform, please check the online documentation for the most up-to-date instructions.