AttributeError while running examples/main.py
haastregt opened this issue · comments
After installing cvxpy and cvxpygen using pip on Ubuntu 20.04, with GCC version 9.4.0, I tried to run the example but got the following error:
Generating code with CVXPYgen ...
Traceback (most recent call last):
File "cvxpygen_test.py", line 32, in
cpg.generate_code(problem, code_dir='nonneg_LS', solver='SCS')
File "/home/jonne/.local/lib/python3.8/site-packages/cvxpygen/cpg.py", line 274, in generate_code
indices_constr, indptr_constr, shape_constr = p_prob.problem_data_index
AttributeError: 'ParamConeProg' object has no attribute 'problem_data_index'
I got a similar error when using the OSQP solver
Generating code with CVXPYgen ...
Traceback (most recent call last):
File "cvxpygen_test.py", line 32, in
cpg.generate_code(problem, code_dir='nonneg_LS', solver='OSQP')
File "/home/jonne/.local/lib/python3.8/site-packages/cvxpygen/cpg.py", line 259, in generate_code
indices_obj, indptr_obj, shape_obj = p_prob.problem_data_index_P
AttributeError: 'ParamQuadProg' object has no attribute 'problem_data_index_P'
Does this error get reproduced for others? Thanks
What version of CVXPY do you have installed?
CVXPY version 1.3.0, CVXPYgen version 0.1.6