From 202ca88e2311bda492757351cef667630fa498de Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 30 Nov 2020 17:37:19 +0100 Subject: [PATCH 1/4] Changes to pi steup --- docs/installation.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 9b15c9685..b6197c905 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -105,13 +105,17 @@ OS Specific steps are listed first, the [Common](#common) section below is neces ``` === "RaspberryPi/Raspbian" - The following assumes the latest [Raspbian Buster lite image](https://www.raspberrypi.org/downloads/raspbian/) from at least September 2019. + The following assumes the latest [Raspbian Buster lite image](https://www.raspberrypi.org/downloads/raspbian/). This image comes with python3.7 preinstalled, making it easy to get freqtrade up and running. Tested using a Raspberry Pi 3 with the Raspbian Buster lite image, all updates applied. + ``` bash sudo apt-get install python3-venv libatlas-base-dev + # Use pywheels.org to speed up installation + sudo echo "[global]\nextra-index-url=https://www.piwheels.org/simple" > sudo tee /etc/pip.conf + git clone https://github.com/freqtrade/freqtrade.git cd freqtrade @@ -120,6 +124,7 @@ OS Specific steps are listed first, the [Common](#common) section below is neces !!! Note "Installation duration" Depending on your internet speed and the Raspberry Pi version, installation can take multiple hours to complete. + Due to this, we recommend to use the prebuild docker-image for Raspberry, by following the [Docker quickstart documentation](docker_quickstart.md) !!! Note The above does not install hyperopt dependencies. To install these, please use `python3 -m pip install -e .[hyperopt]`. From 95b24ba8a931ab8a7d440548f820a40342fb694e Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 30 Nov 2020 20:56:14 +0100 Subject: [PATCH 2/4] Update setup.sh with some specifics --- docs/installation.md | 4 ++-- setup.sh | 28 ++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index b6197c905..4a2450ea2 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -90,13 +90,13 @@ Each time you open a new terminal, you must run `source .env/bin/activate`. ## Custom Installation -We've included/collected install instructions for Ubuntu 16.04, MacOS, and Windows. These are guidelines and your success may vary with other distros. +We've included/collected install instructions for Ubuntu, MacOS, and Windows. These are guidelines and your success may vary with other distros. OS Specific steps are listed first, the [Common](#common) section below is necessary for all systems. !!! Note Python3.6 or higher and the corresponding pip are assumed to be available. -=== "Ubuntu 16.04" +=== "Ubuntu/Debian" #### Install necessary dependencies ```bash diff --git a/setup.sh b/setup.sh index 049a6a77e..83ba42d9b 100755 --- a/setup.sh +++ b/setup.sh @@ -61,13 +61,25 @@ function updateenv() { read -p "Do you want to install dependencies for dev [y/N]? " if [[ $REPLY =~ ^[Yy]$ ]] then - ${PYTHON} -m pip install --upgrade -r requirements-dev.txt + REQUIREMENTS=requirements-dev.txt else - ${PYTHON} -m pip install --upgrade -r requirements.txt - echo "Dev dependencies ignored." + REQUIREMENTS=requirements.txt + fi + SYS_ARCH=$(uname -m) + if [ "${SYS_ARCH}" == "armv7l" ]; then + echo "Detected Raspberry, installing cython." + ${PYTHON} -m pip install --upgrade cython + fi + ${PYTHON} -m pip install --upgrade -r ${REQUIREMENTS} + if [ $? -ne 0 ]; then + echo "Failed installing dependencies" + exit 1 fi - ${PYTHON} -m pip install -e . + if [ $? -ne 0 ]; then + echo "Failed installing Freqtrade" + exit 1 + fi echo "pip install completed" echo } @@ -134,11 +146,11 @@ function reset() { git fetch -a - if [ "1" == $(git branch -vv |grep -c "* develop") ] + if [ "1" == $(git branch -vv | grep -c "* develop") ] then echo "- Hard resetting of 'develop' branch." git reset --hard origin/develop - elif [ "1" == $(git branch -vv |grep -c "* stable") ] + elif [ "1" == $(git branch -vv | grep -c "* stable") ] then echo "- Hard resetting of 'stable' branch." git reset --hard origin/stable @@ -149,7 +161,7 @@ function reset() { fi if [ -d ".env" ]; then - echo "- Delete your previous virtual env" + echo "- Deleting your previous virtual env" rm -rf .env fi echo @@ -253,7 +265,7 @@ function install() { echo "Run the bot !" echo "-------------------------" echo "You can now use the bot by executing 'source .env/bin/activate; freqtrade '." - echo "You can see the list of available bot subcommands by executing 'source .env/bin/activate; freqtrade --help'." + echo "You can see the list of available bot sub-commands by executing 'source .env/bin/activate; freqtrade --help'." echo "You verify that freqtrade is installed successfully by running 'source .env/bin/activate; freqtrade --version'." } From 5f70d1f9a7bc58969cee2c3fa40b981047d22a9a Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 30 Nov 2020 21:10:11 +0100 Subject: [PATCH 3/4] Ask for hyperopt installation during setup closes #2871 --- docs/installation.md | 2 +- setup.sh | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 4a2450ea2..5cc0e03f4 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -114,7 +114,7 @@ OS Specific steps are listed first, the [Common](#common) section below is neces ``` bash sudo apt-get install python3-venv libatlas-base-dev # Use pywheels.org to speed up installation - sudo echo "[global]\nextra-index-url=https://www.piwheels.org/simple" > sudo tee /etc/pip.conf + sudo echo "[global]\nextra-index-url=https://www.piwheels.org/simple" > tee /etc/pip.conf git clone https://github.com/freqtrade/freqtrade.git cd freqtrade diff --git a/setup.sh b/setup.sh index 83ba42d9b..8896331e3 100755 --- a/setup.sh +++ b/setup.sh @@ -56,6 +56,7 @@ function updateenv() { exit 1 fi source .env/bin/activate + SYS_ARCH=$(uname -m) echo "pip install in-progress. Please wait..." ${PYTHON} -m pip install --upgrade pip read -p "Do you want to install dependencies for dev [y/N]? " @@ -65,12 +66,21 @@ function updateenv() { else REQUIREMENTS=requirements.txt fi - SYS_ARCH=$(uname -m) + REQUIREMENTS_HYPEROPT="" + if [ "${SYS_ARCH}" != "armv7l" ]; then + # Is not Raspberry + read -p "Do you want to install hyperopt dependencies for dev [y/N]? " + if [[ $REPLY =~ ^[Yy]$ ]] + then + REQUIREMENTS_HYPEROPT="-r requirements-hyperopt.txt" + fi + fi + if [ "${SYS_ARCH}" == "armv7l" ]; then echo "Detected Raspberry, installing cython." ${PYTHON} -m pip install --upgrade cython fi - ${PYTHON} -m pip install --upgrade -r ${REQUIREMENTS} + ${PYTHON} -m pip install --upgrade -r ${REQUIREMENTS} ${REQUIREMENTS_HYPEROPT} if [ $? -ne 0 ]; then echo "Failed installing dependencies" exit 1 From cec771b59396658d7d89241e869da9459411a4b0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 30 Nov 2020 21:17:50 +0100 Subject: [PATCH 4/4] Ask for plotting dependency installation --- setup.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index 8896331e3..af5e70691 100755 --- a/setup.sh +++ b/setup.sh @@ -67,20 +67,25 @@ function updateenv() { REQUIREMENTS=requirements.txt fi REQUIREMENTS_HYPEROPT="" - if [ "${SYS_ARCH}" != "armv7l" ]; then + REQUIREMENTS_PLOT="" + read -p "Do you want to install plotting dependencies (plotly) [y/N]? " + if [[ $REPLY =~ ^[Yy]$ ]] + then + REQUIREMENTS_PLOT="-r requirements-plot.txt" + fi + if [ "${SYS_ARCH}" == "armv7l" ]; then + echo "Detected Raspberry, installing cython, skipping hyperopt installation." + ${PYTHON} -m pip install --upgrade cython + else # Is not Raspberry - read -p "Do you want to install hyperopt dependencies for dev [y/N]? " + read -p "Do you want to install hyperopt dependencies [y/N]? " if [[ $REPLY =~ ^[Yy]$ ]] then REQUIREMENTS_HYPEROPT="-r requirements-hyperopt.txt" fi fi - if [ "${SYS_ARCH}" == "armv7l" ]; then - echo "Detected Raspberry, installing cython." - ${PYTHON} -m pip install --upgrade cython - fi - ${PYTHON} -m pip install --upgrade -r ${REQUIREMENTS} ${REQUIREMENTS_HYPEROPT} + ${PYTHON} -m pip install --upgrade -r ${REQUIREMENTS} ${REQUIREMENTS_HYPEROPT} ${REQUIREMENTS_PLOT} if [ $? -ne 0 ]; then echo "Failed installing dependencies" exit 1