'SolverError: The solver CVXOPT is not installed. But cp.installed_solvers() show it is installed

Describe the bug Linear mixed-integer solver problem is failing with CVXOPT (or other solvers, same problems).

Execute "print(cp.installed_solvers())" show these solvers installed.

['CVXOPT', 'ECOS', 'ECOS_BB', 'GLPK', 'GLPK_MI', 'GUROBI', 'OSQP', 'SCIPY', 'SCS']

Execute code

order_thod = 500000
lower_budget = 0
upper_budget = 1.1
x = cp.Variable((M_order.shape[1],M_order.shape[0]), boolean=True)
constraits = [cp.trace(M_order.to_numpy() @ x) <= 
upper_budget*order_thod,cp.trace(M_order.to_numpy() @ x) >= 
lower_budget*order_thod, cp.sum(x, axis=0, keepdims=True) <= 1]
objective = cp.Maximize(cp.trace(M_roi.to_numpy() @ x))
prob = cp.Problem(objective, constraits)
prob.solve(solver=cp.CVXOPT, verbose=True)

Error info

SolverError: The solver CVXOPT is not installed.

Thank you!



Solution 1:[1]

I had the same issue (using Anaconda3 and Jupyter Notebook). I restarted the Notebook along with Anaconda because I had pip installed cvxopt inside the Notebook. This fixed the problem. If anyone else has this problem, restart your runtimes!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jop