Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gurobi installation with Julia #445

Closed
arazn845 opened this issue Feb 3, 2022 · 5 comments
Closed

Gurobi installation with Julia #445

arazn845 opened this issue Feb 3, 2022 · 5 comments

Comments

@arazn845
Copy link

arazn845 commented Feb 3, 2022

No description provided.

@arazn845
Copy link
Author

arazn845 commented Feb 3, 2022

I have seen this problem in several different places but I can't sort it out.

using Gurobi
`┌ Info: Precompiling Gurobi [2e9cd046-0924-5485-92f1-d5272153d98b]
└ @ Base loading.jl:1342
ERROR: LoadError: Gurobi not properly installed. Please run Pkg.build("Gurobi"). For
more information go to https://github.com/JuliaOpt/Gurobi.jl

Stacktrace:
[1] error(s::String)
@ Base .\error.jl:33
[2] top-level scope
@ C:\Users\alexn.julia\packages\Gurobi\VhpiN\src\Gurobi.jl:7
[3] include
@ .\Base.jl:384 [inlined]
[4] 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:1235
[5] top-level scope
@ none:1
[6] eval
@ .\boot.jl:360 [inlined]
[7] eval(x::Expr)
@ Base.MainInclude .\client.jl:446
[8] top-level scope
@ none:1
in expression starting at C:\Users\alexn.julia\packages\Gurobi\VhpiN\src\Gurobi.jl:1
Failed to precompile Gurobi [2e9cd046-0924-5485-92f1-d5272153d98b] to C:\Users\alexn.julia\compiled\v1.6\Gurobi\jl_BB54.tmp.

Stacktrace:
[1] error(s::String)
@ Base .\error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IJulia.IJuliaStdio{Base.PipeEndpoint}, internal_stdout::IJulia.IJuliaStdio{Base.PipeEndpoint}, ignore_loaded_modules::Bool)
@ Base .\loading.jl:1385
[3] compilecache(pkg::Base.PkgId, path::String)
@ Base .\loading.jl:1329
[4] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1043
[5] require(uuidkey::Base.PkgId)
@ Base .\loading.jl:936
[6] require(into::Module, mod::Symbol)
@ Base .\loading.jl:923
[7] eval
@ .\boot.jl:360 [inlined]
[8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1116`

ENV["GUROBI_HOME"] = "C:\\gurobi950\\win64" import Pkg Pkg.add("Gurobi") Pkg.build("Gurobi")

Updating registry at C:\Users\alexn\.julia\registries\General
Updating git-repo https://github.com/JuliaRegistries/General.git
Resolving package versions...
No Changes to C:\Users\alexn\.julia\environments\v1.6\Project.toml
No Changes to C:\Users\alexn\.julia\environments\v1.6\Manifest.toml
Building Gurobi → C:\Users\alexn\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\fd27e4cda2c8aae18257eab0c1969f54010f7df0\build.log
Error building Gurobi:
ERROR: LoadError: IOError: readdir("C:\Program Files\gurobi950\win64\bin"): no such file or directory (ENOENT)
Stacktrace:
[1] uv_error
@ .\libuv.jl:97 [inlined]
[2] readdir(dir::String; join::Bool, sort::Bool)
@ Base.Filesystem .\file.jl:830
[3] readdir
@ .\file.jl:825 [inlined]
[4] diagnose_gurobi_install()
@ Main C:\Users\alexn.julia\packages\Gurobi\VhpiN\deps\build.jl:98
[5] top-level scope
@ C:\Users\alexn.julia\packages\Gurobi\VhpiN\deps\build.jl:153
[6] include(fname::String)
@ Base.MainInclude .\client.jl:444
[7] top-level scope
@ none:5
in expression starting at C:\Users\alexn.julia\packages\Gurobi\VhpiN\deps\build.jl:152
Unable to locate Gurobi installation. Running some common diagnostics.

Gurobi.jl only supports the following versions:

  • gurobi90
  • gurobi81
  • gurobi80
  • gurobi75
  • gurobi70

Did you download and install one of these versions from gurobi.com?

Found GUROBI_HOME = C:\Program Files\gurobi950\win64

Does this point to the correct install location?

  • on Windows, this might be C:\Program Files\gurobi810\win64\
  • alternatively, on Windows, this might be C:/Program Files/gurobi810/win64/
  • on OSX, this might be /Library/gurobi810/mac64/
  • on Unix, this might be /home/my_user/gurobi810/linux64/

Note: this has to be a full path, not a path relative to your current
directory or your home directory.

We're going to look for the Gurobi library in this directory:
C:\Program Files\gurobi950\win64\bin

That directory has the following files:

Stacktrace:
[1] pkgerror(msg::String)
@ Pkg.Types C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Types.jl:55
[2] (::Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec})()
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1049
[3] withenv(::Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, ::Pair{String, String}, ::Vararg{Pair{String, B} where B, N} where N)
@ Base .\env.jl:161
[4] (::Pkg.Operations.var"#109#113"{String, Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec})()
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1547
[5] with_temp_env(fn::Pkg.Operations.var"#109#113"{String, Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec}, temp_env::String)
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1449
[6] (::Pkg.Operations.var"#108#112"{Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1522
[7] mktempdir(fn::Pkg.Operations.var"#108#112"{Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)
@ Base.Filesystem .\file.jl:729
[8] mktempdir(fn::Function, parent::String) (repeats 2 times)
@ Base.Filesystem .\file.jl:727
[9] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project)
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1488
[10] build_versions(ctx::Pkg.Types.Context, uuids::Vector{Base.UUID}; verbose::Bool)
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1030
[11] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, verbose::Bool)
@ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:911
[12] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Iterators.Pairs{Symbol, IJulia.IJuliaStdio{Base.PipeEndpoint}, Tuple{Symbol}, NamedTuple{(:io,), Tuple{IJulia.IJuliaStdio{Base.PipeEndpoint}}}})
@ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:900
[13] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::IJulia.IJuliaStdio{Base.PipeEndpoint}, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:80
[14] build(pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:78
[15] #build#71
@ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:76 [inlined]
[16] build
@ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:76 [inlined]
[17] #build#70
@ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:75 [inlined]
[18] build(pkg::String)
@ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:75
[19] top-level scope
@ In[2]:4
[20] eval
@ .\boot.jl:360 [inlined]
[21] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1116

Capture

It looks like I am using the right path but no luck :(

@odow
Copy link
Member

odow commented Feb 3, 2022

You have a very old version of Gurobi.jl. Please update your packages. What is Pkg.status()? It should have v0.10.1 next to "Gurobi".

@arazn845
Copy link
Author

arazn845 commented Feb 6, 2022

Hi Odow

Thanks for the answer.

My Gurobi version is v0.9.14

Pkg.status()
Status C:\Users\alexn\.julia\environments\v1.6\Project.toml
[a076750e] CPLEX v0.7.8
[2e9cd046] Gurobi v0.9.14
[7073ff75] IJulia v1.23.2
[4076af6c] JuMP v0.21.10
[8b8459f2] StochasticPrograms v0.6.3

The problem is I cannot update the Gurobi. When I try doing that it says I have to import Pkg; Pkg.precompile()` or load the package and I cannot do them causes (maybe) my Gurobi is old.

Pkg.update(name="Gurobi")

Updating registry at `C:\Users\alexn\.julia\registries\General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`

Installed JSONSchema ─ v0.3.4
Installed URIs ─────── v1.3.0
Installed HTTP ─────── v0.9.17
Updating C:\Users\alexn\.julia\environments\v1.6\Project.toml
[2e9cd046] ↑ Gurobi v0.8.0 ⇒ v0.9.14
Updating C:\Users\alexn\.julia\environments\v1.6\Manifest.toml
[2e9cd046] ↑ Gurobi v0.8.0 ⇒ v0.9.14
[cd3eb016] ↑ HTTP v0.8.19 ⇒ v0.9.17
[7d188eb4] ↑ JSONSchema v0.3.3 ⇒ v0.3.4
[fdba3010] - MathProgBase v0.7.8
[5c2747f8] + URIs v1.3.0
[a5390f91] - ZipFile v0.9.4
Precompiling project...
✓ URIs
✓ HTTP
✓ JSONSchema
✓ MathOptInterface
✗ Gurobi
✓ CPLEX
✓ JuMP
✓ StochasticPrograms
7 dependencies successfully precompiled in 56 seconds (64 already precompiled)
1 dependency errored. To see a full report either run import Pkg; Pkg.precompile() or load the package.

Is there any solution for this?

@odow
Copy link
Member

odow commented Feb 6, 2022

It seems that StochasticPrograms does not support the latest version of JuMP and MOI:
martinbiel/StochasticPrograms.jl#40

Either use an older version of Gurobi, or uninstall StochasticPrograms.jl.

@odow
Copy link
Member

odow commented Feb 14, 2022

Closing since this is not an issue in Gurobi.jl.

@odow odow closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants