I want to use quantconnect on the computer to use the python debug function.
I cant figure out to use lean.
I tried to install Lean using this video video
I run ubuntu 16.04 Im stuck in the last step:
Develop Algorithms Locally, Run in Containerwhat i did: I opened the config.json file in VisualStudioCode and ran it using debug in container.
first an error message apear : Errors exist after running preLaunchTask 'run-docker'.
I press debug anyway.
then this error message in the terminal comes : what should i do?
I see there is a problem in line 42.
> Executing task: /home/pernille/Lean/run_docker.sh IMAGE=quantconnect/lean:latest CONFIG_FILE=/home/pernille/Lean/Launcher/config.json DATA_DIR=/home/pernille/Lean/Data RESULTS_DIR=/home/pernille/Lean/Results DEBUGGING=Y PYTHON_DIR=/home/pernille/Lean/Algorithm.Python EXIT=Y <
/home/pernille/Lean/run_docker.sh: line 42: cd: ./Launcher/bin/Debug: No such file or directory
/home/pernille/Lean/run_docker.sh: line 42: cd: ./Launcher/bin/Debug: No such file or directory
Csharp file at '/QuantConnect.Algorithm.CSharp.dll' does not exist; no CSharp files will be mounted
Docker container starting, attach to Mono process at localhost:55555 to begin
[sudo] password for pernille:
[sudo] password for pernille:
Sorry, try again.
[sudo] password for pernille:
Error: No such container: LeanEngine
Pulling Docker image: quantconnect/lean:latest
latest: Pulling from quantconnect/lean
Digest: sha256:2e426eaf794ff00e1d00e10b21ab2cc382cecf1c2716c741641b98f59dbcec3e
Status: Image is up to date for quantconnect/lean:latest
Launching LeanEngine with command:
sudo docker run --rm --mount type=bind,source=/home/pernille/Lean/Launcher/config.json,target=/Lean/Launcher/config.json,readonly -v /home/pernille/Lean/Data:/Data:ro -v /home/pernille/Lean/Results:/Results --name LeanEngine -p 5678:5678 --expose 6000 --add-host=host.docker.internal:172.17.0.1 -v /home/pernille/Lean/Algorithm.Python:/Lean/Algorithm.Python -p 55555:55555 --entrypoint mono quantconnect/lean:latest --debug --debugger-agent=transport=dt_socket,server=y,address=0.0.0.0:55555,suspend=y QuantConnect.Lean.Launcher.exe --data-folder /Data --results-destination-folder /Results --config /Lean/Launcher/config.json
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"mono\": executable file not found in $PATH": unknown.
The terminal process "/bin/bash '-c', '/home/pernille/Lean/run_docker.sh IMAGE=quantconnect/lean:latest CONFIG_FILE=/home/pernille/Lean/Launcher/config.json DATA_DIR=/home/pernille/Lean/Data RESULTS_DIR=/home/pernille/Lean/Results DEBUGGING=Y PYTHON_DIR=/home/pernille/Lean/Algorithm.Python EXIT=Y'" terminated with exit code: 127.
Martin etellerandet
I know the way I have set up the config file is not for python. but I just wanted to see if it worked for Csharp. I tried it with python. that didnt help.
Martin etellerandet
I get this error when i change the config file. I just changed this:
// Algorithm language selector - options CSharp, Python
"algorithm-language": "Python",
//Physical DLL location
//"algorithm-location": "QuantConnect.Algorithm.CSharp.dll",
"algorithm-location": "../../../Algorithm.Python/BasicTemplateFrameworkAlgorithm.py",
This is the error:
> Executing task: /home/pernille/Lean/run_docker.sh IMAGE=quantconnect/lean:latest CONFIG_FILE=/home/pernille/Lean/Launcher/config.json DATA_DIR=/home/pernille/Lean/Data RESULTS_DIR=/home/pernille/Lean/Results DEBUGGING=Y PYTHON_DIR=/home/pernille/Lean/Algorithm.Python EXIT=Y <
/home/pernille/Lean/run_docker.sh: line 42: cd: ./Launcher/bin/Debug: No such file or directory
/home/pernille/Lean/run_docker.sh: line 42: cd: ./Launcher/bin/Debug: No such file or directory
Csharp file at '/QuantConnect.Algorithm.CSharp.dll' does not exist; no CSharp files will be mounted
Docker container starting, attach to Mono process at localhost:55555 to begin
[sudo] password for pernille:
Sorry, try again.
[sudo] password for pernille:
Error: No such container: LeanEngine
Pulling Docker image: quantconnect/lean:latest
latest: Pulling from quantconnect/lean
Digest: sha256:2e426eaf794ff00e1d00e10b21ab2cc382cecf1c2716c741641b98f59dbcec3e
Status: Image is up to date for quantconnect/lean:latest
Launching LeanEngine with command:
sudo docker run --rm --mount type=bind,source=/home/pernille/Lean/Launcher/config.json,target=/Lean/Launcher/config.json,readonly -v /home/pernille/Lean/Data:/Data:ro -v /home/pernille/Lean/Results:/Results --name LeanEngine -p 5678:5678 --expose 6000 --add-host=host.docker.internal:172.17.0.1 -v /home/pernille/Lean/Algorithm.Python:/Lean/Algorithm.Python -p 55555:55555 --entrypoint mono quantconnect/lean:latest --debug --debugger-agent=transport=dt_socket,server=y,address=0.0.0.0:55555,suspend=y QuantConnect.Lean.Launcher.exe --data-folder /Data --results-destination-folder /Results --config /Lean/Launcher/config.json
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"mono\": executable file not found in $PATH": unknown.
The terminal process "/bin/bash '-c', '/home/pernille/Lean/run_docker.sh IMAGE=quantconnect/lean:latest CONFIG_FILE=/home/pernille/Lean/Launcher/config.json DATA_DIR=/home/pernille/Lean/Data RESULTS_DIR=/home/pernille/Lean/Results DEBUGGING=Y PYTHON_DIR=/home/pernille/Lean/Algorithm.Python EXIT=Y'" terminated with exit code: 127.
Terminal will be reused by tasks, press any key to close it.
Derek Melchin
Hi Martin,
We recommend following this documentation to setup local debugging for Python in VS Code.
Best,
Derek Melchin
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.
Foren Power
Hey Martin, Derek, and everyone,
So I tried reinstalling this on a few new linux distribution.
MX-Linux (debian base), PopOS (ubuntu base), and Manjaro (arch base).
Each time I get the same error.
Error response from daemon: No such container: LeanEngine
The terminal process "/bin/bash '-c', 'sudo docker stop LeanEngine'" terminated with exit code: 1.
Also, nothing shows up in the call stack on VS code.
None of these problems happened the first time I installed it on a well used ubuntu distro. Clearly I'm doing something wrong.
Jared Broad
We're not able to sustainably provide support for making LEAN work on every NxNxN combination of distros and local environments but we've abstracted it away to support them all via Docker and the LEAN CLI. Please check out the CLI to get LEAN running nicely locally for you.
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.
Foren Power
Just in-case anyone else is trying to test NxNxN linux distributions because I love me some linux.
For manjaro (arch based), just got it working locally, thanks to 1) QuantConnect_Lean's recently updated install guide on github. 2) these two videos:
https://www.youtube.com/watch?v=0mKQ-pjEGj4&t=0s
https://www.youtube.com/watch?v=jpXmUU1uu90&t=0s
3) on arch linux
-A): pamac install mono-msbuild
-B) then using msbuild instead of dotnet in the following two cases:
--Compile Lean Solution:
dotnet QuantConnect.Lean.sln
change to: msbuild QuantConnect.Lean.sln
Run Lean:
cd Launcher/bin/Debug
dotnet QuantConnect.Lean.Launcher.dll
change to: msbuild QuantConnect.Lean.Launcher.dll
Getting msbuild and dotnet to work took a few weeks of running into a brick wall. So, I'm glad to help getting it to work locally on linux.
*These problems are related to other software and unrelated to QuantConnect's code.
Jared Broad
You're brave Foren Power! 😁 Any reason you don't like the CLI?
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.
Foren Power
I’m just a tinkerer. even through sometimes frustrating…into trying to understand the basic parts.
Actually a big fan of the CLI. It’s 10x easier.
-By the way, Martin, anything I can do for you? Hope you got what you wanted too!
Martin etellerandet
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!