I want to use Gurobi on Julia.
When I try to add Gurobi like this, it fails.
julia> import Pkg
julia> Pkg.add("Gurobi")
Resolving package versions...
No Changes to `C:\Users\N185062\.julia\environments\v1.11\Project.toml`
No Changes to `C:\Users\N185062\.julia\environments\v1.11\Manifest.toml`
Precompiling project...
✗ Gurobi
0 dependencies successfully precompiled in 7 seconds. 87 already precompiled.
1 dependency errored.
For a report of the errors see `julia> err`. To retry use `pkg> precompile`
LoadError seem to occur. How can I do?
julia > err
PkgPrecompileError: The following 1 direct dependency failed to precompile:
Gurobi
Failed to precompile Gurobi [2e9cd046-0924-5485-92f1-d5272153d98b] to "C:\\Users\\N185062\\.julia\\compiled\\v1.11\\Gurobi\\jl_6DE.tmp".
ERROR: LoadError: SystemError: opening file "C:\\Users\\N185062\\.julia\\packages\\Gurobi\\8rQku\\deps\\deps.jl": No such file or directory
I’m glad you got it working. It sounds like you might have an older version of Gurobi.jl installed that does not support automatically installing the Gurobi binaries (check what the output of import Pkg; Pkg.status() is), so yes, you needed to run Pkg.build to find the local installation.