Hi,
I'm trying to create a Python virtual environment for Lean and my project. I'm using dataclasses==0.6, matplotlib==3.1.1 which is part of QC supported libraries as I thought that it should also match Lean but for some reason i'm getting this error from Pip:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
rich 9.10.0 requires dataclasses<0.9,>=0.7; python_version >= "3.6" and python_version < "3.7", but you have dataclasses 0.6 which is incompatible.
rich 9.10.0 requires typing-extensions<4.0.0,>=3.7.4, but you have typing-extensions 4.0.1 which is incompatible.
quantconnect-stubs 13287 requires matplotlib>=3.2.1, but you have matplotlib 3.1.1 which is incompatible.
Any idea?
Thanks,
Nir
Niv Sahar
Also, what is the difference between the 2 links?
https://www.quantconnect.com/docs/key-concepts/supported-libraries
https://www.quantconnect.com/docs/v2/lean-cli/user-guides/supported-libraries
Thanks
Fred Painchaud
Hi Nir,
In your first post, your problem is that you are trying to install Python modules which are not inter-compatible. Here is my recommendation:
Use the LEAN CLI. By installing it, appropriate Python packages are going to be installed. Use “pip install --upgrade lean” in your virtual environment.
Now, if you also want to use your virtual environment for local LEAN and Python dev / debugging, you'll most likely have a hard time making Python.NET (inside LEAN) work in a virtual environment. Just so you know…
In your second post, the difference is that the first link is the current documentation, the second one is the equivalent page but for version 2 of the documentation, which is work in progress but current target ETA is Jan 2022.
Fred
Niv Sahar
Thanks Fred.
I see, so we tried to match our packages to those in the first link i've mentioned and it seems like when you upgrade LEAN using “pip install --upgrade lean” it has some compatibility issues. I think we'll just go with the second version of the documentation which matches the current packages in LEAN. Does that make sense?
Btw, I didn't have any issues with Python.NET while trying to work locally with LEAN. 😊
Thanks,
Nir
Fred Painchaud
Hi Nir,
Yes it makes sense. There are sets of Python modules to make LEAN work (locally, without the docker instance), then to make LEAN CLI work (develop and debug algos locally with the docker instance), then to make your Python algorithms work (locally, without the docker instance)… Assessing a user's development environment on a forum beyond “install and use LEAN CLI and the docker instance” is difficult, to say the least. 😊 Hence the creation of LEAN CLI and the docker instance.
I'm super happy you did not have problems with Python.NET! Enjoy local development!
Fred
Niv Sahar
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!