Merge pull request #1470 from freqtrade/fix/installscript

fix and improve installation script
This commit is contained in:
Misagh 2019-01-06 11:55:43 +01:00 committed by GitHub
commit 86023744d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,23 +17,27 @@ function check_installed_python() {
return
fi
if [ -z ${PYTHON} ]; then
echo "No usable python found. Please make sure to have python3.6 or python3.7 installed"
exit 1
fi
}
function updateenv () {
function updateenv() {
echo "-------------------------"
echo "Update your virtual env"
echo "-------------------------"
source .env/bin/activate
echo "pip3 install in-progress. Please wait..."
pip3 install --quiet --upgrade pip
pip3 install --quiet -r requirements.txt --upgrade
pip3 install --quiet -r requirements.txt
# Install numpy first to have py_find_1st install clean
pip3 install --upgrade pip numpy
pip3 install --upgrade -r requirements.txt
read -p "Do you want to install dependencies for dev [Y/N]? "
if [[ $REPLY =~ ^[Yy]$ ]]
then
pip3 install --quiet -r requirements-dev.txt --upgrade
pip3 install --quiet -r requirements-dev.txt
pip3 install --upgrade -r requirements-dev.txt
else
echo "Dev dependencies ignored."
fi
@ -44,7 +48,12 @@ function updateenv () {
}
# Install tab lib
function install_talib () {
function install_talib() {
if [ -f /usr/local/lib/libta_lib.a ]; then
echo "ta-lib already installed, skipping"
return
fi
cd build_helpers
tar zxvf ta-lib-0.4.0-src.tar.gz
cd ta-lib
@ -57,7 +66,7 @@ function install_talib () {
}
# Install bot MacOS
function install_macos () {
function install_macos() {
if [ ! -x "$(command -v brew)" ]
then
echo "-------------------------"
@ -71,7 +80,7 @@ function install_macos () {
}
# Install bot Debian_ubuntu
function install_debian () {
function install_debian() {
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6 python3.6-venv python3.6-dev build-essential autoconf libtool pkg-config make wget git
@ -79,13 +88,13 @@ function install_debian () {
}
# Upgrade the bot
function update () {
function update() {
git pull
updateenv
}
# Reset Develop or Master branch
function reset () {
function reset() {
echo "----------------------------"
echo "Reset branch and virtual env"
echo "----------------------------"
@ -129,7 +138,7 @@ function test_and_fix_python_on_mac() {
fi
}
function config_generator () {
function config_generator() {
echo "Starting to generate config.json"
echo
@ -175,7 +184,7 @@ function config_generator () {
}
function config () {
function config() {
echo "-------------------------"
echo "Config file generator"
@ -201,7 +210,7 @@ function config () {
echo
}
function install () {
function install() {
echo "-------------------------"
echo "Install mandatory dependencies"
echo "-------------------------"
@ -229,7 +238,7 @@ function install () {
echo "You can now use the bot by executing 'source .env/bin/activate; python freqtrade/main.py'."
}
function plot () {
function plot() {
echo "
-----------------------------------------
Install dependencies for Plotting scripts
@ -238,7 +247,7 @@ Install dependencies for Plotting scripts
pip install plotly --upgrade
}
function help () {
function help() {
echo "usage:"
echo " -i,--install Install freqtrade from scratch"
echo " -u,--update Command git pull to update."