2014-10-03 107 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上的其他應用程序一樣安裝。我以這種方式完成了,但尚未測試。