看起来很简单,但我如何将 Pyomo 指向本地安装的求解器?我能够从本地计算机从 NEOS 获得解决方案,因此我知道该模型设计得当。昨天我将 COIN-OR tarfile 安装到 Azure Ubuntu VM 上,并希望使用 Jupyter 在该 VM 上运行我的模型。
这是我到目前为止所拥有的:
solvername='ipopt'
solverpath_folder='~/COIN-OR/bin/'
solverpath_exe='~/COIN-OR/bin/ipopt'
solver=SolverFactory(solvername,executable=solverpath_exe)
instance = model.create_instance()
opt.solve(instance,solver)
错误信息:
WARNING: DEPRECATED: Cannot call Model.create_instance() on a constructed
model; returning a clone of the current model instance.
WARNING: Could not locate the 'ipopt' executable, which is required for solver
ipopt