pyomo无法找到GLPK求解器 [英] Pyomo can't locate GLPK solver

查看:71
本文介绍了pyomo无法找到GLPK求解器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Pyomo与GLPK求解器一起使用.我有一个经过测试的工作模型,但是不断收到错误消息,说找不到GLPK.

I'm trying to use the GLPK solver with Pyomo. I have a working model that's been tested, but keep getting an error saying GLPK can't be found.

警告:无法找到求解器"glpk"所需的"glpsol"可执行文件

WARNING: Could not locate the 'glpsol' executable, which is required for solver 'glpk'

我已经成功安装了glpk.我还将目录添加到我的path变量中,以便可以全局调用执行的目录.我从命令行使用glpsol --help对此进行了测试,并查看了打印的帮助信息.

I've installed glpk sucessfully. I also added the directory to my path variable so the executed can be called globally. I tested this with glpsol --help from my command line, and see the help info printed.

下面的线程说它应该工作,但是可惜没有.

The below thread says it should be working, but alas, it is not.

如何安装glpk-solver以及Winpython中的pyomo

有什么想法吗?

推荐答案

对于有相同问题的任何人,我都找到了一种解决方法(不是解决方案!).我将所有glpk文件复制到了C:/Python27目录中,(惊奇!)Python现在可以找到它们.

For anyone that has the same issue, I found a workaround (not a solution!). I copied all the glpk files into my C:/Python27 directory, and (Surprise!) Python can now find them.

在接受这个解决方案之前,我会坚持一个真正的解决方案.

I'll hold out for a real solution before accepting this one.

这篇关于pyomo无法找到GLPK求解器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆