Skip to content

[ENH] Review ecos, cvxopt, cvxpy dependencies #663

Open

Description

@tschm

Use cvxpy-base and clarabel. The actual solver is an argument to cvxypy's solve attribute of the Problem class. A user can install any solver compatible with cvxpy. For a list see:

https://www.cvxpy.org/tutorial/solvers/index.html

If a user is keen(?) to continue to use ecos (no longer the standard solver for cvxpy) they can install it and instead of solve() call solve("ecos"). Same applies to cvxopt.

Activity

  1. changed the title [-]Remove ecos, cvxopt, cvxpy[/-] [+][ENH] Remove ecos, cvxopt, cvxpy[/+] on Nov 14, 2025
  2. fkiraly commented on Nov 14, 2025

    @fkiraly
    Collaborator

    Yes, I noticed that ecos is not a dependency in essence, but it occurs in some tests and as a default in a method. This default needs to be deprecated, since it is inconsistent with other solver defaults.

    Can you kindly explain what you are suggesting regarding cvxpy though? The package seems central.

    cvxopt is also a soft dependency.

  3. added
    maintenance
    on Nov 14, 2025
  4. changed the title [-][ENH] Remove ecos, cvxopt, cvxpy[/-] [+][ENH] Review `ecos`, `cvxopt`, `cvxpy` dependencies[/+] on Nov 14, 2025
  5. tschm commented on Nov 16, 2025

    @tschm
    ContributorAuthor

    cvxpy is most crucial. cvxpy is an abstraction layer between solvers (ECOS, clarabel, cvxopt, mosek and many others...) It's an amazing tool as it is today the most gentle route into optimization. One can change the solver by providing the name of it to the solve attribute of the Problem class, e.g. I can work in development with clarabel and change for production to Mosek (commercial solver). To simplify life for most developers cvxpy comes with a bunch of solvers. For many years ECOS was the standard solver for cvxpy. But then clarabel came along. But then there is SCS and a few others. Those solvers never disappoint to provide some deployment fun. Hence, cvxpy-base was introduced. It's a stripped version of cvxpy and comes without any pre-installed solvers. So often users combine cvxpy-base with Mosek or cvxpy-base with clarabel. It should not(!) be the task of pyportfolioopt to manage the zoo of solvers out there.

  6. kpj2006 commented on Aug 31, 2026

    @kpj2006

    Dug into the codebase, it's looks like library code is already solver-agnostic, every optimizer (EfficientFrontier, EfficientCVaR, EfficientCDaR, EfficientSemivariance) defaults solver=None and lets cvxpy pick. The one exception is discrete_allocation.lp_portfolio(), which still defaults to "ECOS_BB" , but that's already flagged with a FutureWarning promising it changes to None "in release 1.7.0". We're on 1.6.0 now, so that deprecation is due on the next release regardless of this issue. ecos and cvxopt are already optional extras, not core deps, so that part's already done.

    The remaining piece is @tschm's cvxpy-base + explicit clarabel suggestion. I checked whether it's safe: none of the shipped objectives need an exponential cone or anything solver-specific: the only cp.log() use in the codebase is in a docstring example for a user-written custom objective, not default behavior. So clarabel alone would cover every built-in optimizer.

    The nosoftdeps CI matrix (core + dev, no extras) has tests that explicitly request solver="ECOS", "OSQP", and "SCS" (test_efficient_frontier.py, test_efficient_semivariance.py, test_efficient_cdar.py, test_efficient_cvar.py). Those only work today because full cvxpy bundles those solvers — swapping to cvxpy-base would break them unless those solver packages move into dev/test deps, or those specific tests get gated behind all_extras.

    I think best way is together if the cvxpy-base/clarabel direction has sign-off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions