Merge pull request #4022 from freqtrade/pi_setup

improve setup.sh script
This commit is contained in:
Matthias 2020-12-01 07:03:26 +01:00 committed by GitHub
commit de0c5f9133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 10 deletions

View File

@ -90,13 +90,13 @@ Each time you open a new terminal, you must run `source .env/bin/activate`.
## Custom Installation ## 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. OS Specific steps are listed first, the [Common](#common) section below is necessary for all systems.
!!! Note !!! Note
Python3.6 or higher and the corresponding pip are assumed to be available. Python3.6 or higher and the corresponding pip are assumed to be available.
=== "Ubuntu 16.04" === "Ubuntu/Debian"
#### Install necessary dependencies #### Install necessary dependencies
```bash ```bash
@ -105,13 +105,17 @@ OS Specific steps are listed first, the [Common](#common) section below is neces
``` ```
=== "RaspberryPi/Raspbian" === "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. 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. Tested using a Raspberry Pi 3 with the Raspbian Buster lite image, all updates applied.
``` bash ``` bash
sudo apt-get install python3-venv libatlas-base-dev 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" > tee /etc/pip.conf
git clone https://github.com/freqtrade/freqtrade.git git clone https://github.com/freqtrade/freqtrade.git
cd freqtrade cd freqtrade
@ -120,6 +124,7 @@ OS Specific steps are listed first, the [Common](#common) section below is neces
!!! Note "Installation duration" !!! Note "Installation duration"
Depending on your internet speed and the Raspberry Pi version, installation can take multiple hours to complete. 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 !!! Note
The above does not install hyperopt dependencies. To install these, please use `python3 -m pip install -e .[hyperopt]`. The above does not install hyperopt dependencies. To install these, please use `python3 -m pip install -e .[hyperopt]`.

View File

@ -56,18 +56,45 @@ function updateenv() {
exit 1 exit 1
fi fi
source .env/bin/activate source .env/bin/activate
SYS_ARCH=$(uname -m)
echo "pip install in-progress. Please wait..." echo "pip install in-progress. Please wait..."
${PYTHON} -m pip install --upgrade pip ${PYTHON} -m pip install --upgrade pip
read -p "Do you want to install dependencies for dev [y/N]? " read -p "Do you want to install dependencies for dev [y/N]? "
if [[ $REPLY =~ ^[Yy]$ ]] if [[ $REPLY =~ ^[Yy]$ ]]
then then
${PYTHON} -m pip install --upgrade -r requirements-dev.txt REQUIREMENTS=requirements-dev.txt
else else
${PYTHON} -m pip install --upgrade -r requirements.txt REQUIREMENTS=requirements.txt
echo "Dev dependencies ignored." fi
REQUIREMENTS_HYPEROPT=""
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 [y/N]? "
if [[ $REPLY =~ ^[Yy]$ ]]
then
REQUIREMENTS_HYPEROPT="-r requirements-hyperopt.txt"
fi
fi fi
${PYTHON} -m pip install --upgrade -r ${REQUIREMENTS} ${REQUIREMENTS_HYPEROPT} ${REQUIREMENTS_PLOT}
if [ $? -ne 0 ]; then
echo "Failed installing dependencies"
exit 1
fi
${PYTHON} -m pip install -e . ${PYTHON} -m pip install -e .
if [ $? -ne 0 ]; then
echo "Failed installing Freqtrade"
exit 1
fi
echo "pip install completed" echo "pip install completed"
echo echo
} }
@ -149,7 +176,7 @@ function reset() {
fi fi
if [ -d ".env" ]; then if [ -d ".env" ]; then
echo "- Delete your previous virtual env" echo "- Deleting your previous virtual env"
rm -rf .env rm -rf .env
fi fi
echo echo
@ -253,7 +280,7 @@ function install() {
echo "Run the bot !" echo "Run the bot !"
echo "-------------------------" echo "-------------------------"
echo "You can now use the bot by executing 'source .env/bin/activate; freqtrade <subcommand>'." echo "You can now use the bot by executing 'source .env/bin/activate; freqtrade <subcommand>'."
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'." echo "You verify that freqtrade is installed successfully by running 'source .env/bin/activate; freqtrade --version'."
} }