I am trying to embed JuMP-based Julia script into a Python-based computing framework using PyCall. However, I am facing problems when I define JuMP variable as
from julia import Ipopt
from julia.JuMP import Model
from julia.JuMP import add_constraint
from julia.JuMP import add_variable
m = Model(Ipopt.Optimizer)
add_variable(m, x[1:2]
results in following error message
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-13-61e874849be7> in <module>
1 m = Model(Ipopt.Optimizer)
----> 2 add_variable(m, x[1:2])
NameError: name 'x' is not defined
Is there any document that I can refer to for troubleshooting?