2014-10-03 105 views
1

由于my original question遇到沉默的沉默,我无意中尝试了更多的研究和实验。我认为应该可以在Windows上安装Python 2.7中的PyGLPK,因为我设法在Ubuntu上安装Python 2.7中的PyGLPK,但我似乎无法在Windows 7中执行相同的操作。你可以在Windows中“安装”GLPK,甚至可以在Python 2.7中安装PyGLPK吗?

我开始怀疑它与在Windows上不正确“安装”GLPK有关,但我对如何正确地做到这一点有些遗憾。这样做的“官方”方法(根据this)是“将DLL复制到%SystemRoot%nsystem32(例如c:\ windows \ system32)”,但这很令人困惑,因为在dll文件中有“dll”名称,名称中没有“dll”的dll文件,名称中包含“dll”的批处理文件,未分类为任何特定类型的文件,并且应该直接复制dll的文件或将它们放入文件夹或子文件夹中?我试着将所有东西直接放在C:/ Windows/System32下,但是这并不能帮助我安装PyGLPK。

这是我收到错误消息的全文后,我尝试“蟒蛇setup.py构建--compiler = mingw32的安装”:

running build

running build_ext

building 'glpk' extension

c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Isrc -IC:\Python27\include -IC:\Python27\PC -c src\glpk.c -o build\temp.win32-2.7\Release\src\glpk.o -m32

In file included from src\glpk.c:21:

src\lp.h:24:18: error: glpk.h: No such file or directory

In file included from src\glpk.c:21:

src\lp.h:32: error: expected specifier-qualifier-list before 'glp_prob'

src\lp.h:49: error: expected ')' before '*' token

src\glpk.c: In function 'initglpk':

src\glpk.c:52: error: 'GLP_MAJOR_VERSION' undeclared (first use in this function)

src\glpk.c:52: error: (Each undeclared identifier is reported only once

src\glpk.c:52: error: for each function it appears in.)

src\glpk.c:52: error: 'GLP_MINOR_VERSION' undeclared (first use in this function)

src\glpk.c:53: warning: implicit declaration of function 'glp_version'

src\glpk.c:53: warning: passing argument 2 of 'strcmp' makes pointer from integer without a cast

error: command 'gcc' failed with exit status 1

我真的很希望能够利用这个我的论文项目的工具,所以这对我来说非常重要。感谢任何有任何线索的人在这里做什么。

回答

0

也许你可以从here下载二进制文件,就像在Windows上的其他应用程序一样安装。我以这种方式完成了,但尚未测试。