AttributeError: 'gurobipy.Var' object has no attribute 'getValue'
时间: 2023-08-02 11:09:24 浏览: 419
这个错误是因为在使用gurobipy库时,尝试从一个gurobipy.Var对象中获取值并调用getValue()方法,但是Var对象没有该方法,所以会抛出这个错误。\[3\]解决这个问题的方法是使用getVar()方法来获取变量的值,而不是直接调用getValue()方法。你可以尝试使用var.getVar()来获取变量的值。这样就可以避免出现AttributeError: 'gurobipy.Var' object has no attribute 'getValue'的错误。
#### 引用[.reference_title]
- *1* [AttributeError: 'google.protobuf.py ***' object has no attribute '_value'](https://blog.csdn.net/dongfang1984/article/details/72868732)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [【解决python报错】AttributeError: ‘Figure‘ object has no attribute ‘getvalue’](https://blog.csdn.net/weixin_51268235/article/details/129776327)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文