"Python class failed to compile" build errors

Hi everyone... I'm new to QC (and Python) as of a couple of months ago. While I've been successful in clearing stumbling blocks myself until now, this problem has me stumped (and suspecting it could be the IDE?).

I have created a new module. When compiling it there are several build errors (pasted below) that aren't very explanatory (to me). They seem to be referring to a variable "self.gbpValArray[6]", however even if I remove the entire contents of the relevant function, I still get a single ambiguous "Python class failed to compile" error.

Any advice is appreciated.


94 | 03:41:27: 
Build Error: File: n/a Line:0 Column:0 - Python class failed to compile
195 | 03:41:27: 
Build Error: File: n/a Line:0 Column:0 - Traceback (most recent call last):
196 | 03:41:27: 
Build Error: File: n/a Line:0 Column:0 -     self.gbpValArray[6] = \        
197 | 03:41:27: 
Build Error: File: n/a Line:0 Column:0 - Python class failed to compile

Update Backtest

Unfortunately, a reason for this error can not be determined with the information provided. Please share the algorithm to get more assistance.


Well it turned out there were stray tab or space characters after the newline (i.e. '\') character (on line 91 above). I deleted them and it built perfectly.


Update Backtest


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.


This discussion is closed