Installing cvxpy and CBC solver

Hello,

This platform has been awesome and just what I was looking for. The only thing I am missing so far is an optimizer to assemble portfolios in a more complex manner. To do that, I need to install a few things. I understand how to install python packages in the zipline container, and that all seems very straightforward. I am looking to use an MILP solver with cvxpy (to start testing with at least), so I am able to solve more complex optimization problems. This would require me to use apt-get to install something like CBC (coinor-cbc, coinor-libcbc-dev). I am relatively inexperienced with Docker, but I wanted to know if this was something done in a similar fashion to the python package installation, or if I do this at the droplet level on the cloud/host machine?

Thanks in advance for your help!

Aaron

Glad it's working for you.

Any packages you want to install should be installed in the container(s) where you need them (like installing Python packages), not on the host machine.

Installing packages with apt-get may work, but sometimes it won't work to use those packages with Python because QuantRocket uses conda as its package manager, and conda packages and system packages don't always play well. If you can find conda versions of the packages you need, the chance of success will be higher.

You may find it easier to start by installing the packages in the jupyter container (from a Terminal in JupyterLab). If the install succeeds and you can import the package in Python, then you can repeat the steps in the zipline container. You can reset the container (which will destroy any packages you've installed) with:

docker compose up -d --force-recreate jupyter # or zipline etc 

If you run into problems, I will note that a new QuantRocket release will be out in a week or so, which, among other things, will include a more recent version of scipy, 1.11.3, which includes a MILP solver out of the box.

That is great - I will most definitely wait until the new version is available and try to leverage the scipy MILP solver rather than go down the rabbit hole of installing packages into the container. Thank you so much for the prompt response and solution.

QuantRocket 2.10.0 containing the newer version of scipy is now available: