问题描述
我想在学习中使用"pyomo".我通过easy_install
安装了pyomo coopr安装说明,Pyomo需要求解器才能工作,所以我想安装(GNU线性编程套件) glpk_web ,pyomo似乎安装正确,因为我可以导入它在spyder中(我正在使用WinPython-64bit-2.7.5.3)import coopr.pyomo
I want to use "pyomo" for my studies. I installed pyomo via easy_install
coopr install instructions, Pyomo needs a solver to work so I wanted to install the (GNU Linear Programming Kit) glpk_webpage, pyomo seems to be installed just right because I can import it in spyder (i am using WinPython-64bit-2.7.5.3) withimport coopr.pyomo
但是,我想如果没有glpk我什么也做不了...
However, I cannot do anything without glpk I guess...
我从ftp服务器上下载了glpk-4.52(最新版本),但我不知道该如何处理在"w64"文件夹中找到的批处理文件,我应该根据"安装GLPK "
I downloaded glpk-4.52 (latest version) from the ftp server but I do not know what to do with the batch files I found in the "w64"-folder I should use(?) according to "Installing GLPK"
我没有安装Visual Studio-没有它就无法工作吗?
I do not have Visual Studio installed - Isn't it possible to work without it?
推荐答案
我最近在Windows 7下安装了GLPK,用于python 3.5和pyomo,并想报告一下我如何成功.我通过以下方式安装了pyomo:
I recently installed GLPK for use with python 3.5 and pyomo under windows 7 and would like to report how I succeeded. I installed pyomo via:
pip install pyomo
然后,从此处下载WinGLPK 4.55: WinGLPK
目前,这不适用于较新的版本.
解压缩并将整个w64文件夹复制到C:\w64
在系统PATH中包含文件夹C:\w64
(以便找到glpsol.exe
).
Then, download WinGLPK 4.55 from here: WinGLPK
This does not work for newer versions at the moment.
Unzip it and copy the whole w64 folder to C:\w64
Include folder C:\w64
in your system PATH (so that glpsol.exe
is found).
使用官方pyomo文档中的简单示例检查安装:
Check your installation using the simple example from the official pyomo documentation:
pyomo solve abstract1.py abstract1.dat --solver=glpk
也可以在pyomo文档中找到文件abstract1.py和abstract1.dat.
The files abstract1.py and abstract1.dat can also be found in the pyomo documentation.
我希望这将有助于下一个绝望的GLPK安装程序.
I hope this will help the next desperate GLPK installer.
这篇关于如何在Winpython中将glpk-solver和pyomo一起安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!