我正在安裝/設置Windows 7 64位機器上的Julia。我在安裝GLPK軟件包時遇到問題。到目前爲止,我試圖徹底重新安裝Julia而沒有成功。我嘗試刪除.julia文件夾和我的偏好沒有成功。我總是得到以下錯誤:GLPK安裝錯誤
julia> Pkg.build("GLPK")
INFO: Building GLPK
INFO: Attempting to Create directory C:\Users\Justin\.julia\v0.3\GLPK\deps\downl
oads
INFO: Directory C:\Users\Justin\.julia\v0.3\GLPK\deps\downloads already created
INFO: Downloading file http://downloads.sourceforge.net/project/winglpk/winglpk/
GLPK-4.52/winglpk-4.52.zip
INFO: Done downloading file http://downloads.sourceforge.net/project/winglpk/win
glpk/GLPK-4.52/winglpk-4.52.zip
INFO: Attempting to Create directory C:\Users\Justin\.julia\v0.3\GLPK\deps\src
INFO: Directory C:\Users\Justin\.julia\v0.3\GLPK\deps\src already created
INFO: Attempting to Create directory C:\Users\Justin\.julia\v0.3\GLPK\deps
INFO: Directory C:\Users\Justin\.julia\v0.3\GLPK\deps already created
INFO: Attempting to Create directory C:\Users\Justin\.julia\v0.3\GLPK\deps\src\g
lpk-4.52\w32
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
Processing archive: C:\Users\Justin\.julia\v0.3\GLPK\deps\downloads\winglpk-4.52
.zip
Error: Can not open file as archive
================================[ ERROR: GLPK ]=================================
failed process: Process(`7z x 'C:\Users\Justin\.julia\v0.3\GLPK\deps\downloads\w
inglpk-4.52.zip' -y '-oC:\Users\Justin\.julia\v0.3\GLPK\deps\src'`, ProcessExite
d(2)) [2]
while loading C:\Users\Justin\.julia\v0.3\GLPK\deps\build.jl, in expression star
ting on line 66
================================================================================
================================[ BUILD ERRORS ]================================
WARNING: GLPK had build errors.
- packages with build errors remain installed in C:\Users\Justin\.julia\v0.3
- build the package(s) and all dependencies with `Pkg.build("GLPK")`
- build a single package by running its `deps/build.jl` script
================================================================================
這在我看來,這個問題是「winglpk-4.52.zip」如果我嘗試直接訪問並解壓縮文件,我得到的是說,一個錯誤文件無效,Windows無法打開。我嘗試刪除GLPK,從頭開始,也沒有運氣。
任何想法或建議嗎?
更新:手動下載文件'winglpk-4.52.zip'並解壓到位置'C:\ Users \ Justin.julia \ v0.3 \ GLPK \ deps \ src'可以解決問題。
不過,我得到另一個錯誤(不知道這是有關):
Cannot construct an affine expression with a term of type
(GenericAffExpr{Float64,Variable})*(Float64)
while loading In[6], in expression starting on line 16
in error at error.jl:21 (repeats 2 times)
這個錯誤涉及到的命令:
@setObjective(myModel, Max, sum{x[i,j]*data[i,5], i=1:n,j=1:8});
我已經在我的Mac安裝茱莉亞這樣做不會給出錯誤..
我認爲sourceforge存在一些問題,但他們似乎現在已經解決了。 – mlubin 2015-02-11 14:15:26