Julia adding an older version of my updated Gurobi Solber

Hi! I’m working with Julia 1.6.5 and Gurobi 9.5.0 on Visual Studio. I’ve acquired an academic license and have uninstall and reinstall everything twice. I can’t figure out why when adding Gurobi, Julia chooses a previous edition instead of the latest one. I’ve set the correct environment path for Gurobi and placed the license there as well. You can see below the errors I’m getting.

When simply executing “Pkg.add” I’m getting
julia> Pkg.add(“Gurobi”)
Resolving package versions…
Updating C:\Users\Nosdi\AppData\Local\NEMO\depot\environments\v1.6\Project.toml
[2e9cd046] + Gurobi v0.8.1
Updating C:\Users\Nosdi\AppData\Local\NEMO\depot\environments\v1.6\Manifest.toml
[2e9cd046] + Gurobi v0.8.1
[fdba3010] + MathProgBase v0.7.8
✗ Gurobi
0 dependencies successfully precompiled in 22 seconds (41 already precompiled)
1 dependency errored. To see a full report either run import Pkg; Pkg.precompile() or load the package

And the precompile shows that:
ERROR: The following 1 direct dependency failed to precompile:
Gurobi [2e9cd046-0924-5485-92f1-d5272153d98b]
Failed to precompile Gurobi [2e9cd046-0924-5485-92f1-d5272153d98b] to C:\Users\Nosdi\AppData\Local\NEMO\depot\compiled\v1.6\Gurobi\jl_D792.tmp.
ERROR: LoadError: Gurobi not properly installed. Please run Pkg.build(“Gurobi”).

Finally Pkg.build is facing this issue:
julia> Pkg.build(“Gurobi”)
Building Gurobi → C:\Users\Nosdi\AppData\Local\NEMO\depot\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\f36a2fa62909675681aec582ccfc4a4a629406e4\build.log
ERROR: Error building Gurobi:
ERROR: LoadError: Unable to locate Gurobi installation. If the advice above did not help,
open an issue at GitHub - jump-dev/Gurobi.jl: Julia interface for Gurobi Optimizer and post the full
print-out of this diagnostic attempt.

Stacktrace:
[1] error(s::String)
@ Base .\error.jl:33
[2] top-level scope
@ C:\Users\Nosdi\AppData\Local\NEMO\depot\packages\Gurobi\7YNJV\deps\build.jl:154
[3] include(fname::String)
@ Base.MainInclude .\client.jl:444
[4] top-level scope
@ none:5
in expression starting at C:\Users\Nosdi\AppData\Local\NEMO\depot\packages\Gurobi\7YNJV\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:\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:\gurobi950\win64\bin

That directory has the following files:

  • C:\gurobi950\win64\bin\Gurobi95.NET.XML
  • C:\gurobi950\win64\bin\Gurobi95.NET.dll
  • C:\gurobi950\win64\bin\GurobiJni95.dll
  • C:\gurobi950\win64\bin\grb_ts.exe
  • C:\gurobi950\win64\bin\grbcluster.exe
  • C:\gurobi950\win64\bin\grbgetkey.exe
  • C:\gurobi950\win64\bin\grbprobe.exe
  • C:\gurobi950\win64\bin\grbtune.exe
  • C:\gurobi950\win64\bin\gurobi.bat
  • C:\gurobi950\win64\bin\gurobi95.dll
  • C:\gurobi950\win64\bin\gurobi95_light.dll
  • C:\gurobi950\win64\bin\gurobi_cl.exe
  • C:\gurobi950\win64\bin\vslauncher.exe
  • C:\gurobi950\win64\bin\vswhere.exe

We were looking for (but could not find) a file named like
libgurobiXXX.so, libgurobiXXX.dylib, or gurobiXXX.dll. You
should update your GUROBI_HOME environment variable to point to the
correct location.

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, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
@ 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::Base.TTY, 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
@ REPL[8]:1

I know nothing about Gurobi, but according to that error message gurobi95 is not on the supported list.

1 Like

Although looks like it’s supported in current versions of Gurobi.jl (https://github.com/jump-dev/Gurobi.jl/blob/master/deps/build.jl#L20-L22), so you may have an old version of Gurobi.jl. Did you try Pkg.update()?

1 Like

Hi @Keno, indeed it should be supported as it is working for a colleague of mine. Yes updating leads to no changes in Project.toml’ or Manifest.toml’. What would be interesting is to update Gurobi.jl somehow manually but I have no clue on how could that be possible.

The error message indicates that it only knows about versions through 0.8.1. What is your registry status:

(@v1.8) pkg> registry st
Registry Status 
 [23338594] General (https://github.com/JuliaRegistries/General.git)

?

(@v1.6) pkg> registry st
Registry Status
[23338594] General (GitHub - JuliaRegistries/General: The official registry of general Julia packages)
[ef78e00e] NEMORegistry (C:/Users/Jason/Dropbox/Research/Next Gen Modeling/Julia/Nemo Installer/NEMO_registry)

This is what I’m getting.

What is import Pkg; pkg"add Gurobi@0.10"

p.s. please don’t post duplicate questions: ERROR: LoadError: Unable to locate Gurobi installation. I’ll move this to the optimization section.

1 Like

Hi @odow, adding Gurobi10 manually outputs this:

(@v1.6) pkg> add Gurobi@0.10
Resolving package versions…
ERROR: Unsatisfiable requirements detected for package Gurobi [2e9cd046]:
Gurobi [2e9cd046] log:
├─possible versions are: 0.5.0-0.8.1 or uninstalled
└─restricted to versions 0.10 by an explicit requirement — no versions left

So yeah it is probably an older version but I cannot update it, when I remove and add the Gurobi pkg, Julia always installs Gurobi v0.8.1, which I’m not sure why is restricted since I deleted and reinstalled both Julia and Gurobi from scratch.

I’m sorry about the duplication btw it’s just that I need to deliver an assignment soon!

It seems like you’re using this NEMO thing? Installation · NEMO

That have restrictions on what solver versions they support. Gurobi 9.5 isn’t one of the supported versions.

1 Like

I have no idea what this is. I uninstalled it and run registry status and it’s still there. The weird thing is that I’m connected anyhow to Dropbox and have User called Jason in my Users nor can I find a similar file anywhere. Any ideas on how to completely remove it from my Julia registry? :slight_smile:

Try

] registry remove NEMORegistry
] registry update
] add Gurobi@0.10

Still doesn’t although it seems like the remove worked:

(@v1.6) pkg> registry st
Registry Status
[23338594] General (GitHub - JuliaRegistries/General: The official registry of general Julia packages)
[ef78e00e] NEMORegistry (C:/Users/Jason/Dropbox/Research/Next Gen Modeling/Julia/Nemo Installer/NEMO_registry)

(@v1.6) pkg> registry remove NEMORegistry
Removing registry NEMORegistry from C:\Users\Nosdi\AppData\Local\NEMO\depot\registries\NEMORegistry

(@v1.6) pkg> registry update

(@v1.6) pkg> add Gurobi@0.10
Resolving package versions…
ERROR: Unsatisfiable requirements detected for package Gurobi [2e9cd046]:
Gurobi [2e9cd046] log:
├─possible versions are: 0.5.0-0.8.1 or uninstalled
└─restricted to versions 0.10 by an explicit requirement — no versions left

(@v1.6) pkg> registry st
Registry Status
[23338594] General (GitHub - JuliaRegistries/General: The official registry of general Julia packages)

julia> Pkg.update()
No Changes to C:\Users\Nosdi\AppData\Local\NEMO\depot\environments\v1.6\Project.toml
No Changes to C:\Users\Nosdi\AppData\Local\NEMO\depot\environments\v1.6\Manifest.toml

what is the result of:

] st

In your current setup?

Did you try a new environment from scratch?

] activate my_new_env
] add Gurobi@0.10

(@v1.6) pkg> st
Status C:\Users\Nosdi\AppData\Local\NEMO\depot\environments\v1.6\Project.toml
[9961bab8] Cbc v0.7.0
[e2554f3b] Clp v0.8.0
[2e9cd046] Gurobi v0.8.1
[4076af6c] JuMP v0.21.2

(@v1.6) pkg> activate my_new_env
Activating new environment at C:\Users\Nosdi\my_new_env\Project.toml

(my_new_env) pkg> add Gurobi@0.10
Resolving package versions…
ERROR: Unsatisfiable requirements detected for package Gurobi [2e9cd046]:
Gurobi [2e9cd046] log:
├─possible versions are: 0.5.0-0.8.1 or uninstalled
└─restricted to versions 0.10 by an explicit requirement — no versions left

I think the way to go is to uninstall everything completely and re-install them, nothing seems to work for Gurobi. Btw my Julia works fine, the Gurobi Solver is the one not responding.

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

That directory has the following files:

  • C:\gurobi950\win64\bin\Gurobi95.NET.XML
  • C:\gurobi950\win64\bin\Gurobi95.NET.dll
  • C:\gurobi950\win64\bin\GurobiJni95.dll
  • C:\gurobi950\win64\bin\grb_ts.exe
  • C:\gurobi950\win64\bin\grbcluster.exe
  • C:\gurobi950\win64\bin\grbgetkey.exe
  • C:\gurobi950\win64\bin\grbprobe.exe
  • C:\gurobi950\win64\bin\grbtune.exe
  • C:\gurobi950\win64\bin\gurobi.bat
  • C:\gurobi950\win64\bin\gurobi95.dll
  • C:\gurobi950\win64\bin\gurobi95_light.dll
  • C:\gurobi950\win64\bin\gurobi_cl.exe
  • C:\gurobi950\win64\bin\vslauncher.exe
  • C:\gurobi950\win64\bin\vswhere.exe

We were looking for (but could not find) a file named like
libgurobiXXX.so, libgurobiXXX.dylib, or gurobiXXX.dll. You
should update your GUROBI_HOME environment variable to point to the
correct location.

This is by far the strangest when building the package, because this file is right there but probably from the “wrong” gurobi edition ( - C:\gurobi950\win64\bin\gurobi95.dll)

Also, when installing the gurobi license the default location that my computer provides is a very random location - not within gurobi950 file. Could that be an issue as well?

(@v1.6) pkg> st
Status C:\Users\Nosdi\AppData\Local\NEMO\depot\environments\v1.6\Project.toml

I still think you’re running NEMO’s version of Julia, which must have some additional things that is preventing Gurobi from updating to the latest version.

I think the way to go is to uninstall everything completely and re-install them

Yes, I think this is the way to go. Install Julia from Download Julia.

Perfect thank you everyone for your help very much! I’m gonna close the post now