python - 如何让 GAMS 的求解器从 Pyomo 工作?
问题描述
我想运行一个用 pyomo 语言编写的模型,使用 cplex 解算器。但是我收到以下错误:
"No 'gams' command found on system PATH - GAMS shell"
NameError: No 'gams' command found on system PATH - GAMS shell solver
functionality is not available. "
我已将文件夹 (C:\GAMS\win64\25.1) 添加到系统的环境变量中。Pyomo 版本是 5.6.5。Python 是 3.5.2。和 GAMS 是 25.1.2
如果您能为我提供帮助,我将不胜感激。
solvername = 'gams'
opt = SolverFactory(solvername)
results = opt.solve(
instance, solver='cplex', keepfiles=True, tee=True)
解决方案
推荐阅读
- css - 我如何更改 bootstrap-vue datepicker 中的填充?
- c# - 如何在 UWP 应用程序(C# 或 WinJS)中获取 Windows 10 版本(例如 1809、1903、1909...)?
- javascript - 如何使用 vue js 提醒点击元素的 id?
- c++ - 如何使用 CMake 更改构建机器类型
- git - BFG ERROR: BFG aborting: No refs to update - nodirty commits found
- flutter - 如何使用自定义布局从 Firestore 循环数据
- java - 如何获取键值并对哈希图中的值执行一些操作
- python - Python - 使用 OR 条件过滤行
- java - 如何为我的 android 锻炼应用程序进行设置?
- git - git 使用 .gitattributes 中的什么规则来确定文件类型和行尾?