# Problem in installing Gurobi.jl (ipopt shows infeasible )

**URL:** <https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845>\
**Category:** Optimization (Mathematical)\
**Tags:** gurobi\
**Created:** [April 22, 2022, 2:59pm UTC](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845 "2022-04-22T14:59:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![HosseinF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hosseinf/32/35059_2.png) [@HosseinF](https://discourse.julialang.org/u/HosseinF)\
**Post date:** [April 22, 2022, 2:59pm UTC](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845/1 "2022-04-22T14:59:07Z")

</div>

Hi,

I wanted to solve a two stage stochastic problem via ipopt solver but it does not solved and shows:

> Converged to a point of local infeasibility. Problem may be infeasible. LOCALLY INFEASIBLE┌ Warning: Stochastic program could not be solved, returned status: LOCALLY INFEASIBLE julia

I found from one of previous discussion that I should use another solver.

I tried to use Gurobi.

The version of Gurobi I installed on my system (windows) is 951 and with academic license. I followed the instruction in [https://github.com/jump-dev/Gurobi.jl](https://github.com/jump-dev/Gurobi.jl) and set `ENV["GUROBI_HOME"]` as `"C:\\gurobi951\\win64"` where the Gurobi file is located.

From the command `Pkg.add("Gurobi")`, I faced to this summery of installation:

```julia
...
✗ Gurobi
  ✓ JuMP
  ✓ StochasticPrograms
  35 dependencies successfully precompiled in 62 seconds (45 already precompiled)
  29 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

```

From last command of `Pkg.build("Gurobi")` , I faced to this error:

```julia
ERROR: Error building `Gurobi`:
ERROR: LoadError: Unable to locate Gurobi installation.

```

What would be the solution?

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [April 23, 2022, 12:29am UTC](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845/2 "2022-04-23T00:29:36Z")

</div>

Hi Hossein,

Things to try:

- Set up the environment variable GUROBI\_HOME as a Windows user environment variable (ie not in Julia);
- Close and re-open a new session of Julia, and check the value of `ENV[GUROBI_HOME]`
- then Pkg.add Gurobi

(This type of question will likely get the best answer if asked directly to the Optimization topic,)

---

<div class="post-metadata">

**Author:** ![cvanaret](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cvanaret/32/11594_2.png) [@cvanaret](https://discourse.julialang.org/u/cvanaret)\
**Post date:** [April 23, 2022, 5:50pm UTC](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845/3 "2022-04-23T17:50:48Z")

</div>

Other option: you start Ipopt from a different initial point.

---

<div class="post-metadata">

**Author:** ![HosseinF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hosseinf/32/35059_2.png) [@HosseinF](https://discourse.julialang.org/u/HosseinF)\
**Post date:** [April 23, 2022, 7:10pm UTC](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845/4 "2022-04-23T19:10:10Z")

</div>

I set up it, hopefully `Pkg.add("Gurobi")` successfully installed the Gurobi (but version 0.9.14 while there exists minimum of 0.10.1 and I faced error when I want to install that specific version which is compatible which Gurobi 951).

However, I faced an error in commanding `Pkg.build("Gurobi")`:

```julia
ERROR: Error building `Gurobi`:
ERROR: LoadError: Unable to locate Gurobi installation.

```

---

<div class="post-metadata">

**Author:** ![HosseinF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hosseinf/32/35059_2.png) [@HosseinF](https://discourse.julialang.org/u/HosseinF)\
**Post date:** [April 23, 2022, 7:29pm UTC](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845/5 "2022-04-23T19:29:12Z")

</div>

> [@cvanaret](#):
>
> Ipopt from a different initial point

Thanks! I’ll try different initial point.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [April 24, 2022, 10:19am UTC](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845/6 "2022-04-24T10:19:41Z")

</div>

The issue might be due to having StochasticPrograms in your environment. As you saw, the latest version of Gurobi.jl that "knows about’ Gurobi 9.5 is not able to run in concert with StochasticPrograms. This is known [issue](https://github.com/jump-dev/Gurobi.jl/issues/445#issuecomment-1030906543).  
The recommendation is to use an older version of Gurobi; version 9.1 will be more than suitable.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [April 24, 2022, 10:23pm UTC](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845/7 "2022-04-24T22:23:16Z")

</div>

Yes, you can’t use StochasticPrograms.jl and the latest version of Gurobi.jl.
