Hi all,
Just a quick notice for those coding in python with PyCharm. I noticed that I am unable to locally debug my algos but was able to do so just a few days ago.
The error I get in the logs is as follow :
Traceback (most recent call last):
File "/opt/miniconda3/lib/python3.8/site-packages/_pydevd_bundle/pydevd_process_net_command.py", line 311, in process_net_command
thread_id, frame_id, scope, group_type = text.split('\t', 3)
ValueError: not enough values to unpack (expected 4, got 3)
I figured it would have to do with the docker container used to debug my backtests since I'm always using the latest tag (so I see the image being updated from time to time). I tried setting the image to a previous revision (I chose the tag 15672 because I know for sure it was working 2 weeks ago).
Sure enough, this fixes the problem and I can debug my backtests with this previous image.
To set you local lean config to a previous image use the command (for the mentioned tag) :
lean config set engine-image quantconnect/lean:15672
Don't know if that matter but I'm coding on a Mac M1 using PyCharm 2022 (never managed to debug on PyCharm 2023 but don't remember what the problem was).
This is also a message to the devs, it would be great if someone could find the root cause (don't know what changed exactly or if it matters. I'll run more debugging tests in a few days to see if the issue is fixed).
Happy coding :)
Mia Alissi
It seems like you're having trouble debugging your Python algorithms in PyCharm due to an error with the Docker container. You've found a workaround by using a previous version of the Docker image.
To debug your Python algorithms locally in PyCharm, you can follow these steps as mentioned in the QuantConnect Documentation:
lean backtest
command with the--debug pycharm
option.If you're still encountering issues, it might be helpful to check the forum discussions or the documentation for any updates or similar issues. If the problem persists, consider reaching out to the QuantConnect community or support for further assistance.
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.
Jared Broad
Thank you for letting us know mjn we'll look into it.
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.
Mjn
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!