Hello,
I am trying to set up lean on my local machine and have access to TA-Lib. I have properly edited my config file, ~/.zprofile, built the QuantConnect.Lean.sln, and ran dotnet Quantconnect.Lean.Launcher.dll with success. From here when I launch the research enviornment I get an issue with importing TA-Lib which is due to the fact that TA-Lib requires an older version of numpy or sometimes I simply get the “no module named talib” error. I attached a link below to the requirements.txt for TA-lib. So I installed numpy 1.26 and then when I rebuild QuantConnect.Lean.sln and run dotnet Quantconnect.Lean.Launcher.dll there is a stack overflow (error below). After further investigation I have confirmed this only happens with the older version of numpy. Any help would be very much appericated. I have also tried using the TalibIndicatorsAlgorithm.py set up without any luck. Thank you.
-Noah
Error:
TRACE:: AlgorithmPythonWrapper(): Python version 3.11.9 (main, Apr 19 2024, 11:49:16) [Clang 14.0.6 ]: Importing python module BasicTemplateFrameworkAlgorithm
Stack overflow.
Mia Alissi
Hi Noah,
From the knowledge sources provided, it seems that TA-Lib is indeed supported in Lean as mentioned here. However, the specific issue you're encountering with numpy version and stack overflow isn't directly addressed in the provided sources.
For the "no module named talib" error, it might be due to the TA-Lib not being correctly installed or not being in the correct path. You might want to double-check your installation and the paths.
For the stack overflow error, it's hard to pinpoint the exact cause without more information. It could be due to many reasons such as infinite recursion, excessive memory usage, or an issue with the older version of numpy as you mentioned.
Unfortunately, without more specific information related to QuantConnect and Lean, it's hard to provide a more detailed solution. I would recommend checking the QuantConnect documentation and the Lean GitHub page for more information. If the issue persists, you might want to ask this question in the Lean community for more specialized help.
I hope this helps and good luck with your algorithm development!
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.
Noah Huerta
Okay thank you. The PATH seems to be okay along with the PYTHONNET_PYDLL Yeah I am sure there is a way since it is working in the cloud. I will keep working on it.
-Noah
Mia Alissi
Hi Noah,
I'm glad to hear that you're making progress. It's great that your PATH and PYTHONNET_PYDLL are set correctly.
As you continue troubleshooting, remember that Lean supports Python 3.6 as mentioned here and here. Make sure your local setup aligns with this.
If you're still encountering issues, consider reaching out to the QuantConnect community on their forum or Slack. They might have encountered similar issues and could provide more specific guidance.
Keep up the good work, and don't hesitate to ask if you have more questions!
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.
Noah Huerta
Sorry to continue with this further but I have been working on this for weeks. I investigated further and I believe the issue lies in having to choose Foundation-Py-Default. Ta-lib is not included in the site packages for this interpreter. Thank you.
Mia Alissi
Hi Noah,
I understand your frustration and appreciate your patience. From the knowledge sources provided, it's confirmed that TA-Lib is included in the Lean environment as mentioned here and here.
However, if you're having trouble accessing TA-Lib in the Foundation-Py-Default environment, it might be due to some configuration issues.
Unfortunately, without more specific information related to QuantConnect and Lean, it's hard to provide a more detailed solution. I would recommend checking the QuantConnect documentation and the Lean GitHub page for more information. If the issue persists, you might want to ask this question in the Lean community for more specialized help.
I hope this helps and good luck with your algorithm development!
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.
Noah Huerta
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!