Gurobi does not work with Juli 172
回答済みI am using Julia 1.7.2. on Jupyter Notebook (Anaconda). I ve installed Gurobi 952 with an Academic lisense .But, I cannot using with Julia. I have the following error messages:
How can I fix the problem?
Thank you
Info: Precompiling Gurobi [2e9cd046-0924-5485-92f1-d5272153d98b]
└ @ Base loading.jl:1423
ERROR: LoadError: SystemError: opening file "C:\\Users\\edmon\\.julia\\packages\\Gurobi\\cnAYk\\deps\\deps.jl": No such file or directory
Stacktrace:
[1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
@ Base .\error.jl:174
[2] #systemerror#68
@ .\error.jl:173 [inlined]
[3] systemerror
@ .\error.jl:173 [inlined]
[4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
@ Base .\iostream.jl:293
[5] open
@ .\iostream.jl:282 [inlined]
[6] open(f::Base.var"#364#365"{String}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base .\io.jl:328
[7] open
@ .\io.jl:328 [inlined]
[8] read
@ .\io.jl:436 [inlined]
[9] _include(mapexpr::Function, mod::Module, _path::String)
@ Base .\loading.jl:1249
[10] include(mod::Module, _path::String)
@ Base .\Base.jl:418
[11] include(x::String)
@ Gurobi C:\Users\edmon\.julia\packages\Gurobi\cnAYk\src\Gurobi.jl:1
[12] top-level scope
@ C:\Users\edmon\.julia\packages\Gurobi\cnAYk\src\Gurobi.jl:8
[13] include
@ .\Base.jl:418 [inlined]
[14] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base .\loading.jl:1318
[15] top-level scope
@ none:1
[16] eval
@ .\boot.jl:373 [inlined]
[17] eval(x::Expr)
@ Base.MainInclude .\client.jl:453
[18] top-level scope
@ none:1
in expression starting at C:\Users\edmon\.julia\packages\Gurobi\cnAYk\src\Gurobi.jl:1
Failed to precompile Gurobi [2e9cd046-0924-5485-92f1-d5272153d98b] to C:\Users\edmon\.julia\compiled\v1.7\Gurobi\jl_CD94.tmp. Stacktrace: [1] error(s::String) @ Base .\error.jl:33 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool) @ Base .\loading.jl:1466 [3] compilecache(pkg::Base.PkgId, path::String) @ Base .\loading.jl:1410 [4] _require(pkg::Base.PkgId) @ Base .\loading.jl:1120 [5] require(uuidkey::Base.PkgId) @ Base .\loading.jl:1013 [6] require(into::Module, mod::Symbol) @ Base .\loading.jl:997 [7] eval @ .\boot.jl:373 [inlined] [8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String) @ Base .\loading.jl:1196
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Edmond,
Can you first make sure you have the latest version of Gurobi.jl installed, and then rebuild the package? The latest Gurobi.jl version right now is 0.11.0, so the sequence of commands in the Julia package manager should be:
] update
] add Gurobi@0.11.0
] build GurobiType
]to enter the Pkg mode, then type the rest of each line. Also, please ensure the GUROBI_HOME environment variable is set correctly to point to your Gurobi installation.Best regards,
Simon0 -
Thank you but now ...the message is:
Resolving package versions... No Changes to `C:\Users\33688\.julia\environments\v1.7\Project.toml` No Changes to `C:\Users\33688\.julia\environments\v1.7\Manifest.toml`
UndefVarError: with_optimizer not defined Stacktrace: [1] top-level scope @ In[9]:7 [2] eval @ .\boot.jl:373 [inlined] [3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String) @ Base .\loading.jl:1196
0 -
Hi Edmond,
It looks like you are using the older JuMP API (which uses with_optimizer). You'll need to update your code to use the following method to build a model:
using JuMP
using Gurobi
model = Model(Gurobi.Optimizer)as outlined in the JuMP example codes.
0
投稿コメントは受け付けていません。
コメント
4件のコメント