Closed hsm207 closed 4 years ago
Hi @hsm207 it is already installed in that container. Mind sharing more detail on what you're trying to achieve?
@jaredbroad I'm trying to develop algorithms locally using Python and VS Code.
Based on the content of DockerfileLeanFoundation, I can see that the python interpreter being used is located at /opt/miniconda3/bin/python
inside the quantconnect/lean
image. But if I launch that interpreter and execute:
import clr
I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'clr'
This made me think that pythonnet is not installed.
But it is interesting to note that if I run the interpreter with mono /Lean/Launcher/bin/Debug/nPython.exe
then I can successfully run import clr
. Unfortunately, this way of starting the Python interpreter is not supported in VS Code.
Do you have any recommendations on how people can get started developing algorithms in Python locally? I'm open to using any IDE as long I can develop in a containerized environment.
Hi @hsm207 it is already installed in that container.
@jaredbroad I don't think it's already installed in that container. Running pip freeze | grep pythonnet
in that container does not return any results.
Hey @hsm207,
You are right, pythonNet isn't installed but it is present. Due to pythonNet issues, currently, for linux, we have two different binaries for different use case scenarios: C# calling PY (default for running Launcher/QCAlgorithms) and Py calling C#. Believe the use case you want is Py->C#, which matches the use case of Research since that case isn't the default it requires copying over the right clr/pythonNet binary can be seen in the previous link. Maybe you could test directly using the research docker image for this use case quantconnect/research
. For running the algorithm, through the launcher, quantconnect/lean
should be used. I hope this helps!
@Martin-Molinero thanks for the suggestion. The research docker image was exactly what I needed.
Environment
Details
Describe what you were trying to get done.
I am trying to install pythonnet inside the lean docker container.
What commands did you run to trigger this issue? If you can provide a Minimal, Complete, and Verifiable example this will help us understand the issue.
Installing from the original repo works. This command:
returns: