Problem with model.getAttr("VarName", model.getVars())
AnsweredHello everyone,
I'm trying to retrive Names of variables using names=model.getAttr("VarName", model.getVars())
but i get this error bellow, i tried everything online but nothing works for me.
Thanks in advance,
Hamza ADDI
Error :
UnicodeDecodeError Traceback (most recent call last)
C:\Users\HAMZA~1.ADD\AppData\Local\Temp/ipykernel_8020/4003909886.py in <module>
1 values=model.getAttr("X", model.getVars())
----> 2 names=model.getAttr("VarName", model.getVars())
3 result = dict(zip(names, values))
src\gurobipy\model.pxi in gurobipy.Model.getAttr()
src\gurobipy\attrutil.pxi in gurobipy.__gettypedattrlist()
src\gurobipy\extern.pxi in gurobipy.__bytestostring()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 31: invalid continuation byte
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?. -
This issue is discussed in the post Variable names not available.
1
Post is closed for comments.
Comments
2 comments