Files
OpenBB/website/content/terminal/installation/source.md
Theodore Aptekarev 417769c4cc Improve installation experience and documentation (#4508)
* hi didier

* Add files

* Include build deps and third-party binaries in conda env files

* Add the changelogs from GH

* Api keys + cleaning up spelling + found some old refs

* spelling

* Merge branch 'feature/documentation3p0' of https://github.com/OpenBB-finance/OpenBBTerminal into feature/documentation3p0

* updates to faq sections

* spelling

* fixing FA so it runs

* adding guides - need pics

* Add gcc and maturin to build dependencies

* telegram/discord docs markdown format conversion

* Remove gcc from conda env files

* Update install from source guide for terminal

* fix: added new reference styles

* adding examples to discord - remove play button

* updating bot docs

* Update SDK installation docs

* Bump datetime package in lock file because current version was yanked

* Update requirements txts

* Remove rust tools from main conda env

* Pin poetry to 1.4.0 because of a regression in 1.4.1

* Bump version of lightgbm to 3.3.5

* Address formatting and minor content comments

* Advise all users to clean up conda artifacts with scripts

* Add placeholder for pywry related docs

* Update requirements.txt

* Downgrade statsforecast to prevent pulling jupyter-dash

* Add catboost to conda dependencies for windows install to work

* Add charset-normalizer to conda deps because of a buggy windows build

* Add xgboost to conda deps because of a buggy windows build

* working!!

* 3.8 and 3.9 xgboost

* spelling

* Point sdk install from source to terminal source install

* image showing on docs

Co-authored-by: jose-donato <jose-donato@users.noreply.github.com>

* feat: added imageurl for examples

* updates Stocks SDK intro

* bot pics update

* Bump python version on macOS CI builds

* updating rest of bot docs

* Move charset-normalizer to the pip section of environment yamls

* Update mac CI workflows to use the correct cache

* Move poetry to pip section of the conda yamls

* Fix typo in file path

* Fix direct_url.json files not being deleted on the CI

* Fool reviewpad

* Actually fool reviewpad

* adding code for generating index and bot updates

* linting

* add commands for GTK on linux

* Update deps after conflicts and CRLF line endings made it into develop

* test bump down for matplotlib

* codesign more dylibs

* intel workflow

* Add signing stuff that failed to intel

* M1 file now

* Remove duplicate lines from codesigning section of build instructions

* Downgrade matplotlib to 3.7.0 to mitigate windows error

* Downgrade python to 3.9 in attempt to fix scipy not packaging correctly

* Downgrade python 3.9 to resolve conflicts found by conda

* Remove duplicate xgboost references

* Downgrade scikit-learn to avoid DistanceMetric32 not being found

* Remove site-packages from bundle following python 3.10 -> 3.9

* Downgrade scikit-learn to avoid DistanceMetric32 not being found

* Fix english in source installation

* Revert advised python to 3.9

* Update SDK installation docs

* Fix typo

* Update lock file hash

* Consolidate all installation instructions in the terminal section

* Add --no-cache-dir to pip calls

* Fool reviewpad

* Remove reference of the conda cleanup from the pypi install

* Fetch the environment yaml directly from the repo without downloading it

* Add rosetta, cpp build tools and libomp as top level requirements

* Update installation links in repo readme

* adds brew install libomp to FAQ section

* fix typo from my updatet

* Capitalization of Section Headers

* puts PyPi toolkit install in quotes, necessary for a non-bash shell.

* grammar fixes

* update docker windows instructions

---------

Co-authored-by: James Maslek <jmaslek11@gmail.com>
Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com>
Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Co-authored-by: teh_coderer <me@tehcoderer.com>
Co-authored-by: jose-donato <zmcdonato@gmail.com>
Co-authored-by: jose-donato <jose-donato@users.noreply.github.com>
2023-03-29 17:53:35 +00:00

8.6 KiB
Vendored

title, sidebar_position, description, keywords
title sidebar_position description keywords
Source 3 This section provides steps to install the OpenBB Terminal and SDK from source. This installation type supports Windows, macOS and Linux systems.
installation
installer
install
guide
mac
windows
linux
python
github
macos
how to
explanation
openbb terminal

This section provides steps to install the OpenBB Terminal and SDK from source. This installation type supports Windows, macOS and Linux systems. Before starting the installation process, make sure the following pieces of software are installed.

Miniconda Miniconda is a Python environment and package manager. It is required for installing certain dependencies.

Go here to find the download for your operating system or use the links below:

To verify if Miniconda is installed on the system, open the command line and run the following command:

conda --version

If Miniconda is installed, a version number will be displayed, for example:

conda 23.1.0
Git

Check to verify if Git is installed by running the following command:

git --version

Which will print something like this:

git version 2.31.1

If Git is not installed, install it now from conda by running:

conda install git

Or follow the instructions here to install it.

Microsoft C++ Build Tools (Windows only)

Use the instructions here to install or update Microsoft C++ Build Tools.

Rosetta2 (Apple Silicon only)

Install Rosetta from the terminal with:

softwareupdate --install-rosetta
LibOMP (Apple Silicon only)

Apple Silicon does not ship libomp by default. It will need to be installed manually for some features of the ML toolkit to work. The libomp library can be installed from homebrew.

Check if Homebrew is installed by running the following command:

brew --version

If Homebrew is not installed, install it by running:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Or follow the instructions here.

To install LibOMP, run the following command:

brew install libomp
VcXsrv (Windows Subsystem for Linux only)

Since a WSL installation is headless by default (i.e., there is only access to a terminal running a Linux distribution) there are additional steps required to display visualizations. A more detailed tutorial is found, here.

  • Dynamically export the DISPLAY environment variable in WSL2:
# add to the end of ~/.bashrc file
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
# source the file
source ~/.bashrc
  • Download and install VcXsrv
  • When running the program is important to check "Disable access control"

After this, VcXsrv should be running successfully, and the machine is ready to proceed with the terminal installation.

Alternatives to VcXsrv include:

GTK toolchains (Linux only)

GTK is a window extension that is used to display interactive charts and tables. The library responsible for interactive charts and tables (pywry) requires certain dependencies, based on the Linux distribution, to be installed first.

Debian-based / Ubuntu / Mint
sudo apt install libwebkit2gtk-4.0-dev
Arch Linux / Manjaro
sudo pacman -S webkit2gtk-4.0
Fedora
sudo dnf install gtk3-devel webkit2gtk4.0-devel

Proceed to next steps once the requirements above have been met.

Clone the Source Code

Clone the OpenBB Terminal source code from GitHub. This will download the source code to the current working directory.

git clone https://github.com/OpenBB-finance/OpenBBTerminal.git

Enter the directory:

cd OpenBBTerminal

Create and Activate the Virtual Environment

Create the environment by copying the code below into the command line and agreeing to the prompts.

conda env create -n obb --file build/conda/conda-3-9-env.yaml

After the obb environment is created, activate it by entering:

conda activate obb

:::note When the new environment is activated for the first time, it is required to clean up some artifacts in order for all dependencies to work nicely.

On macOS and Linux do this by running this script (copy and paste the launch code):

build/conda/cleanup_artifacts.sh

On Windows do this by running this script (copy and paste the launch code):

build/conda/cleanup_artifacts.bat

:::

Install the OpenBB Terminal

Make sure to have completed all previous steps. If followed, the current working directory will be the location where the OpenBB Terminal source code lives.

Install the remaining dependencies and the terminal through Poetry, a package manager.

poetry install -E all

:::info

Read about Conda, Poetry and Python package management

For the best user experience we advise using conda and poetry for environment setup and dependency management. Conda ships binaries for packages like numpy so these dependencies are not built from source locally by pip. Poetry solves the dependency tree in a way that the dependencies of dependencies of dependencies use versions that are compatible with each other.

For Conda environments, the build/conda folder contains multiple .yaml configuration files to choose from.

When using other Python distributions we highly recommend a virtual environment like virtualenv or pyenv for installing the terminal dependency libraries.

For people who prefer using "vanilla" pip the requirements files are found in the project root:

  • requirements.txt list main dependencies
  • requirements-full.txt list all the dependencies including Machine Learning and Portfolio Optimization libraries and dependencies for developers

They can be installed with pip:

pip install -r requirements.txt

The dependency tree is solved by poetry.

Note: The libraries specified in the requirements files have been tested and work for the purpose of this project, however, these may be older versions. Hence, it is recommended for the user to set up a Python virtual environment prior to installing them. This keeps dependencies required by different projects in separate places.

After installing the requirements, install the terminal with:

pip install .
:::

Once this installation process is completed, start the terminal by running:

python terminal.py

NOTE: When the OpenBB Terminal is opened next, the Python environment will need to be activated again. When using a code editor, make sure that the correct environment is selected. This should be easy to figure out if there is an error stating that there are missing packages. To launch the OpenBB Terminal application in a new terminal window, first navigate into the folder where the source code was cloned, and then use the following two commands:

conda activate obb
python terminal.py

TROUBLESHOOTING: Having difficulty getting through the installation, or encountering errors? Reach out to our Discord community for help.