From 119cadcb2ba03eb4b109831e6f9a43674e156b72 Mon Sep 17 00:00:00 2001 From: Hanlei Qin Date: Fri, 24 Oct 2025 19:55:57 +0800 Subject: [PATCH 1/5] Replace pip with uv for package installations in setup.sh --- setup.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index 5e0800ab8..7641c7250 100755 --- a/setup.sh +++ b/setup.sh @@ -49,7 +49,7 @@ function updateenv() { source .venv/bin/activate SYS_ARCH=$(uname -m) echo "pip install in-progress. Please wait..." - ${PYTHON} -m pip install --upgrade pip wheel setuptools + ${PYTHON} -m pip install --upgrade pip wheel setuptools uv REQUIREMENTS_HYPEROPT="" REQUIREMENTS_PLOT="" REQUIREMENTS_FREQAI="" @@ -70,7 +70,7 @@ function updateenv() { fi if [ "${SYS_ARCH}" == "armv7l" ] || [ "${SYS_ARCH}" == "armv6l" ]; then echo "Detected Raspberry, installing cython, skipping hyperopt installation." - ${PYTHON} -m pip install --upgrade cython + ${PYTHON} -m uv pip install --upgrade cython else # Is not Raspberry read -p "Do you want to install hyperopt dependencies [y/N]? " @@ -92,12 +92,12 @@ function updateenv() { fi fi - ${PYTHON} -m pip install --upgrade -r ${REQUIREMENTS} ${REQUIREMENTS_HYPEROPT} ${REQUIREMENTS_PLOT} ${REQUIREMENTS_FREQAI} ${REQUIREMENTS_FREQAI_RL} + ${PYTHON} -m uv pip install --upgrade -r ${REQUIREMENTS} ${REQUIREMENTS_HYPEROPT} ${REQUIREMENTS_PLOT} ${REQUIREMENTS_FREQAI} ${REQUIREMENTS_FREQAI_RL} if [ $? -ne 0 ]; then echo "Failed installing dependencies" exit 1 fi - ${PYTHON} -m pip install -e . + ${PYTHON} -m uv pip install -e . if [ $? -ne 0 ]; then echo "Failed installing Freqtrade" exit 1 @@ -252,7 +252,7 @@ function install() { function plot() { echo_block "Installing dependencies for Plotting scripts" - ${PYTHON} -m pip install plotly --upgrade + ${PYTHON} -m uv pip install plotly --upgrade } function help() { From 9f7b7ef8896612448f5264407548e930202f9410 Mon Sep 17 00:00:00 2001 From: Hanlei Qin Date: Sat, 25 Oct 2025 12:33:14 +0800 Subject: [PATCH 2/5] Use uv instead of pip if available --- setup.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index 7641c7250..a6e0c1f2b 100755 --- a/setup.sh +++ b/setup.sh @@ -32,6 +32,11 @@ function check_installed_python() { if [ $? -eq 0 ]; then echo "using ${PYTHON}" check_installed_pip + PIP="${PYTHON} -m pip" + if [ -x "$(command -v uv)" ]; then + echo "uv detected — using it instead of pip for faster installation." + PIP="uv pip" + fi return fi done @@ -49,7 +54,7 @@ function updateenv() { source .venv/bin/activate SYS_ARCH=$(uname -m) echo "pip install in-progress. Please wait..." - ${PYTHON} -m pip install --upgrade pip wheel setuptools uv + ${PIP} install --upgrade pip wheel setuptools REQUIREMENTS_HYPEROPT="" REQUIREMENTS_PLOT="" REQUIREMENTS_FREQAI="" @@ -92,12 +97,12 @@ function updateenv() { fi fi - ${PYTHON} -m uv pip install --upgrade -r ${REQUIREMENTS} ${REQUIREMENTS_HYPEROPT} ${REQUIREMENTS_PLOT} ${REQUIREMENTS_FREQAI} ${REQUIREMENTS_FREQAI_RL} + ${PIP} install --upgrade -r ${REQUIREMENTS} ${REQUIREMENTS_HYPEROPT} ${REQUIREMENTS_PLOT} ${REQUIREMENTS_FREQAI} ${REQUIREMENTS_FREQAI_RL} if [ $? -ne 0 ]; then echo "Failed installing dependencies" exit 1 fi - ${PYTHON} -m uv pip install -e . + ${PIP} install -e . if [ $? -ne 0 ]; then echo "Failed installing Freqtrade" exit 1 @@ -252,7 +257,7 @@ function install() { function plot() { echo_block "Installing dependencies for Plotting scripts" - ${PYTHON} -m uv pip install plotly --upgrade + ${PIP} install plotly --upgrade } function help() { From 4fc5f33fa13bc5fcafeea9360fb7002f953ce5aa Mon Sep 17 00:00:00 2001 From: Hanlei Qin Date: Sat, 25 Oct 2025 15:16:20 +0800 Subject: [PATCH 3/5] fix an omission --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index a6e0c1f2b..732306e83 100755 --- a/setup.sh +++ b/setup.sh @@ -75,7 +75,7 @@ function updateenv() { fi if [ "${SYS_ARCH}" == "armv7l" ] || [ "${SYS_ARCH}" == "armv6l" ]; then echo "Detected Raspberry, installing cython, skipping hyperopt installation." - ${PYTHON} -m uv pip install --upgrade cython + ${PIP} install --upgrade cython else # Is not Raspberry read -p "Do you want to install hyperopt dependencies [y/N]? " From 9595936d73dba1663f9365f9f0f709ee5ecc8504 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 26 Oct 2025 09:04:30 +0100 Subject: [PATCH 4/5] chore: fix uv only install --- setup.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index 732306e83..b1b102585 100755 --- a/setup.sh +++ b/setup.sh @@ -6,6 +6,7 @@ function echo_block() { echo $1 echo "----------------------------" } +UV=false function check_installed_pip() { ${PYTHON} -m pip > /dev/null @@ -24,6 +25,13 @@ function check_installed_python() { echo "You can do this by running 'deactivate'." exit 2 fi + if [ -x "$(command -v uv)" ]; then + echo "uv detected — using it instead of pip for faster installation." + PIP="uv pip" + PYTHON="python3.13" + UV=true + return + fi for v in 13 12 11 do @@ -33,10 +41,6 @@ function check_installed_python() { echo "using ${PYTHON}" check_installed_pip PIP="${PYTHON} -m pip" - if [ -x "$(command -v uv)" ]; then - echo "uv detected — using it instead of pip for faster installation." - PIP="uv pip" - fi return fi done @@ -184,7 +188,12 @@ function recreate_environments() { fi echo - ${PYTHON} -m venv .venv + if [ "$UV" = true ] ; then + echo "- Creating new virtual environment with uv" + uv venv .venv --python=${PYTHON} + else + ${PYTHON} -m venv .venv + fi if [ $? -ne 0 ]; then echo "Could not create virtual environment. Leaving now" exit 1 From 16dd4073ff5a072810b955eea9959bf33420248a Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 26 Oct 2025 09:32:36 +0100 Subject: [PATCH 5/5] docs: update setup script docs for uv support --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 3efe6593f..583d3969a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -24,7 +24,7 @@ The easiest way to install and run Freqtrade is to clone the bot Github reposito The `stable` branch contains the code of the last release (done usually once per month on an approximately one week old snapshot of the `develop` branch to prevent packaging bugs, so potentially it's more stable). !!! Note - Python3.11 or higher and the corresponding `pip` are assumed to be available. The install-script will warn you and stop if that's not the case. `git` is also needed to clone the Freqtrade repository. + Either [uv](https://docs.astral.sh/uv/), or Python3.11 or higher and the corresponding `pip` are assumed to be available. The install-script will warn you and stop if that's not the case. `git` is also needed to clone the Freqtrade repository. Also, python headers (`python-dev` / `python-devel`) must be available for the installation to complete successfully. !!! Warning "Up-to-date clock"