A script which runs perfectly in Pycharm can not be implemented in the Matlab environment.
AnsweredThe following errors occur.
Traceback (most recent call last):
File "dualSP.py", line 138, in <module>
[Aeq,Aineq,beq,bineq,f]=BVRP()
File "dualSP.py", line 107, in BVRP
A=m1.getA()
File "model.pxi", line 288, in gurobipy.Model.__getattr__
File "model.pxi", line 1576, in gurobipy.Model.getAttr
File "model.pxi", line 4403, in gurobipy.Model.__getattrinfo
AttributeError: 'gurobipy.Model' object has no attribute 'getA'
0
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Canqi,
You cannot simply run a Python script in Matlab. The APIs are very different. Please consult our documentation for further information.
The error message seems to be coming from Python, though, and suggest that you need to update your Gurobi installation - getA() was only introduced in version 9.0. You may also have an error in the Python code because getA() is a method and not an attribute, so you may be missing the brackets.
Cheers,
Matthias0
Post is closed for comments.
Comments
2 comments