3

I have a python 2.7 code translating it into python 3.6 code.

When I run:

from cvxopt import solvers, matrix
(...)
P = matrix(P)
q = matrix(q)
G = matrix(G)
h = matrix(h)
A = matrix(A)
b = matrix(b)
sol = solvers.qp(P, q, G, h, A, b)

I get this error:

Traceback (most recent call last):
  File "C:\Users\jaime.lazcano\Documents\Projects\myproject\optimization.py", line 85, in run_optimizacion
    sol = solvers.qp(P, q, G, h, A, b)
  File "C:\ProgramData\Anaconda2\envs\myproject\lib\site-packages\cvxopt\coneprog.py", line 4487, in qp
    return coneqp(P, q, G, h, None, A,  b, initvals, kktsolver = kktsolver, options = options)
  File "C:\ProgramData\Anaconda2\envs\myproject\lib\site-packages\cvxopt\coneprog.py", line 2243, in coneqp
    if iters == 0:  W = misc.compute_scaling(s, z, lmbda, dims)
  File "C:\ProgramData\Anaconda2\envs\myproject\lib\site-packages\cvxopt\misc.py", line 285, in compute_scaling
    W['d'] = base.sqrt( base.div( s[mnl:mnl+m], z[mnl:mnl+m] ))
ValueError: domain error

The code works on python 2.7 but not on python 3.6.

What should I do?

I don't know what the format would be for python 3.6

jalazbe
  • 1,801
  • 3
  • 19
  • 40
  • 1
    I have looking for and it might be a compatibility error. On `python 3.6.6.`I may only use `cvxopt==1.2.0`. when I try to downgrade cvxopt to `1.1.9` it it asks me to modify my python version to `3.5.0` – jalazbe Oct 26 '18 at 11:38

0 Answers0