Back

Error running template python algo after fresh install

Hi QC team, 

I have finally succeed to run locally lean with python from VS2019. After tried to use existing conda environment, I have installed 3.6.6 from python.org and linked QC.PythonToolbox and Algorythm.PythonTools project to this new Python Environment with VS2019.

Minimal packages has been installed:

D:\Dev2\Python36>pip list
Package Version
--------------- -------
blis 0.2.4
numpy 1.18.1
pandas 0.25.3
pip 20.0.2
preshed 2.0.1
python-dateutil 2.8.1
pytz 2019.3
setuptools 39.0.1
six 1.14.0
spacy 2.1.1
thinc 7.0.4
wasabi 0.1.4
wrapt 1.10.11

I am trying to run this config :

  "environment": "backtesting", // "live-paper", "backtesting", "live-interactive", "live-interactive-iqfeed"
  "algorithm-type-name": "BasicTemplateAlgorithm",
  "algorithm-language": "Python",
  "algorithm-location": "../../../Algorithm.Python/BasicTemplateAlgorithm.py",

 And I get a stackoverflow exception:

An unhandled exception of type 'System.StackOverflowException'
occurred in Python.Runtime.dll

The program '[9680] QuantConnect.Lean.Launcher.exe' has exited with code -1 (0xffffffff).

I precise that "Python.Runtime.dll" file version in debug is 1.0.5.29 ( 13.11.2019 20:02 )

Lean log is :

 

2020-01-28T15:55:25.9046392Z TRACE:: Config.Get(): Configuration key not found. Key: data-directory - Using default value: ../../../Data/
2020-01-28T15:55:25.9056384Z TRACE:: Config.Get(): Configuration key not found. Key: version-id - Using default value:
2020-01-28T15:55:25.9056384Z TRACE:: Config.Get(): Configuration key not found. Key: cache-location - Using default value: ../../../Data/
2020-01-28T15:55:25.9056384Z TRACE:: Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v2.4.0.0 Mode: DEBUG (64bit)
2020-01-28T15:55:25.9586065Z TRACE:: Engine.Main(): Started 16:55
2020-01-28T15:55:25.9636028Z TRACE:: Config.GetValue(): job-project-id - Using default value: 0
2020-01-28T15:55:25.9686000Z TRACE:: Config.GetValue(): regression-update-statistics - Using default value: False
2020-01-28T15:55:25.9686000Z TRACE:: Config.Get(): Configuration key not found. Key: lean-manager-type - Using default value: LocalLeanManager
2020-01-28T15:55:25.9865886Z TRACE:: Config.Get(): Configuration key not found. Key: cloud-api-url - Using default value: https://www.quantconnect.com/api/v2/
2020-01-28T15:55:26.0265639Z TRACE:: JobQueue.NextJob(): Selected ../../../Algorithm.Python/BasicTemplateAlgorithm.py
2020-01-28T15:55:26.0625414Z TRACE:: Python for .NET Assembly: Python.Runtime, Version=1.0.5.29, Culture=neutral, PublicKeyToken=null
2020-01-28T15:55:26.2004567Z TRACE:: Python for .NET Assembly: nPython, Version=1.0.5.29, Culture=neutral, PublicKeyToken=null
2020-01-28T15:55:26.3873408Z TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-capacity - Using default value: 120
2020-01-28T15:55:26.3883416Z TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-refill-amount - Using default value: 18
2020-01-28T15:55:26.3883416Z TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-time-interval-minutes - Using default value: 1440
2020-01-28T15:55:26.3903392Z TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-capacity - Using default value: 120
2020-01-28T15:55:26.3903392Z TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-refill-amount - Using default value: 18
2020-01-28T15:55:26.3903392Z TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-time-interval-minutes - Using default value: 1440
2020-01-28T15:55:26.4163233Z TRACE:: Config.GetValue(): ignore-version-checks - Using default value: False
2020-01-28T15:55:26.4193222Z TRACE:: AlgorithmManager.CreateTokenBucket(): Initializing LeakyBucket: Capacity: 120 RefillAmount: 18 TimeInterval: 1440
2020-01-28T15:55:26.4243185Z TRACE:: Config.GetValue(): algorithm-manager-time-loop-maximum - Using default value: 20
2020-01-28T15:55:26.9589896Z TRACE:: PythonInitializer.Initialize(): start...
2020-01-28T15:55:29.4987721Z TRACE:: PythonInitializer.Initialize(): ended
2020-01-28T15:55:29.5143967Z TRACE:: AlgorithmPythonWrapper(): Python version 3.6.6rc1 (v3.6.6rc1:1015e38be4, Jun 12 2018, 08:38:06) [MSC v.1900 64 bit (AMD64)]:
Importing python module BasicTemplateAlgorithm

 

Is there anything I must do ?

Update Backtest







0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hey Christophe,

That is very strange.

Are you sure you are running the basic template algorithm? It is possible another python algorithm may be running which is causing the stackoverflow error.

We know it's a huge hassle uninstalling and reinstalling LEAN and its counterparts. But it would be great if you could try running it again on a clean install of LEAN.

If that doesn't work, we recommend uninstalling Python completely and doing a clean installation of Anaconda with Python 3.6.8.

Best
Rahul

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed