You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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.
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.
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.
Activity
[-]Remove ecos, cvxopt, cvxpy[/-][+][ENH] Remove ecos, cvxopt, cvxpy[/+]fkiraly commentedon Nov 14, 2025
Yes, I noticed that
ecosis 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 othersolverdefaults.Can you kindly explain what you are suggesting regarding
cvxpythough? The package seems central.cvxoptis also a soft dependency.[-][ENH] Remove ecos, cvxopt, cvxpy[/-][+][ENH] Review `ecos`, `cvxopt`, `cvxpy` dependencies[/+]tschm commentedon Nov 16, 2025
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.
kpj2006 commentedon Aug 31, 2026
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.