From 718d2847ac0a13cc1cc8314867c787b036159d23 Mon Sep 17 00:00:00 2001 From: fmhc Date: Wed, 18 Aug 2021 23:37:31 +0100 Subject: [PATCH 1/2] added try/except for pandas_ta import error --- NostalgiaForInfinityNext.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/NostalgiaForInfinityNext.py b/NostalgiaForInfinityNext.py index 763844036c..06701a435b 100644 --- a/NostalgiaForInfinityNext.py +++ b/NostalgiaForInfinityNext.py @@ -17,11 +17,19 @@ from datetime import datetime, timedelta from technical.util import resample_to_interval, resampled_merge from technical.indicators import zema, VIDYA, ichimoku -import pandas_ta as pta + log = logging.getLogger(__name__) +try: + import pandas_ta as pta +except ImportError: + log.warning("### IMPORTANT: you have not installed pandas_ta.\nIf you're running Docker, add\nRUN pip install pandas_ta\nto your Dockerfile, otherwise run \npip install pandas_ta") +else: + log.info("pandas_ta successfully imported") + + ########################################################################################################### ## NostalgiaForInfinityV8 by iterativ ## ## ## From 437a2b58b4a9d32cdf5f2c2fe11606e3912401b7 Mon Sep 17 00:00:00 2001 From: fmhc Date: Wed, 18 Aug 2021 23:49:52 +0100 Subject: [PATCH 2/2] changed log type to error --- NostalgiaForInfinityNext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NostalgiaForInfinityNext.py b/NostalgiaForInfinityNext.py index 06701a435b..0689a832c5 100644 --- a/NostalgiaForInfinityNext.py +++ b/NostalgiaForInfinityNext.py @@ -25,7 +25,7 @@ try: import pandas_ta as pta except ImportError: - log.warning("### IMPORTANT: you have not installed pandas_ta.\nIf you're running Docker, add\nRUN pip install pandas_ta\nto your Dockerfile, otherwise run \npip install pandas_ta") + log.error("IMPORTANT - please install the pandas_ta python module which is needed for this strategy. If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: pip install pandas_ta") else: log.info("pandas_ta successfully imported")