# Install Gurobi in Mac JuliaPro

**URL:** <https://discourse.julialang.org/t/install-gurobi-in-mac-juliapro/17580>\
**Category:** Tooling\
**Tags:** juliapro\
**Created:** [November 15, 2018, 10:19pm UTC](https://discourse.julialang.org/t/install-gurobi-in-mac-juliapro/17580 "2018-11-15T22:19:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GabrielYin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gabrielyin/32/6059_2.png) [@GabrielYin](https://discourse.julialang.org/u/GabrielYin)\
**Post date:** [November 15, 2018, 10:19pm UTC](https://discourse.julialang.org/t/install-gurobi-in-mac-juliapro/17580/1 "2018-11-15T22:19:03Z")

</div>

Hi there,

I am a new JuliaPro user in Mac OS. I tried to install/build Gurobi but the error raised as it cannot locate the Gurobi installation. In JuliaPro I cannot do “export GUROBI\_HOME=”/Library/gurobi800/mac64" like in the terminal. Then how can I tell my JuliaPro the location of Gurobi?

BTW I’ve already got the academic license of Gurobi and it worked well when I opened the terminal version of Gurobi. The Gurobi version is 8.0.1 and the JuliaPro version is 1.0.1.1.

Thanks in advance!  
Gabriel

---

<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:** [November 15, 2018, 10:43pm UTC](https://discourse.julialang.org/t/install-gurobi-in-mac-juliapro/17580/2 "2018-11-15T22:43:48Z")

</div>

You just need to set your system environment variable for `GUROBI_HOME` (if it isn’t already). You can check what it is set to by

```julia
julia> ENV["GUROBI_HOME"]
"C:\\gurobi801\\win64"

```

You might also be runing into [https://github.com/JuliaOpt/Gurobi.jl/issues/169](https://github.com/JuliaOpt/Gurobi.jl/issues/169). In which case, wait for [https://github.com/JuliaOpt/Gurobi.jl/pull/170](https://github.com/JuliaOpt/Gurobi.jl/pull/170) to be merged and a new release tagged.

If it’s urgent, follow the instructions here (if it works, please report back 🙂):  
[https://github.com/JuliaOpt/Gurobi.jl/issues/169#issuecomment-438044950](https://github.com/JuliaOpt/Gurobi.jl/issues/169#issuecomment-438044950)

---

<div class="post-metadata">

**Author:** ![GabrielYin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gabrielyin/32/6059_2.png) [@GabrielYin](https://discourse.julialang.org/u/GabrielYin)\
**Post date:** [November 15, 2018, 10:56pm UTC](https://discourse.julialang.org/t/install-gurobi-in-mac-juliapro/17580/3 "2018-11-15T22:56:41Z")

</div>

Thank you for your reply!

Can you tell me where to run the command “ENV[“GUROBI\_HOME”]”? In your figure it seems to be run in the original julia\> command line, but it showed:

 ![fig1](https://global.discourse-cdn.com/julialang/original/3X/b/f/bfd81e97a84a82dc103a1fab290009df7536a0d5.jpeg)  
And it also did not work in the pkg\> command line.

Another issue is, Gurobi can be well installed and built if I use the Anaconda Julia 1.0.1, since I can easily do “export GUROBI\_HOME=”/Library/gurobi800/mac64” there. So I think if it can work fine with Gurobi 8.0.1 and Conda/Julia 1.0.1, then it may not be the issue reported in the link.

Thanks!

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [November 16, 2018, 1:13am UTC](https://discourse.julialang.org/t/install-gurobi-in-mac-juliapro/17580/4 "2018-11-16T01:13:12Z")

</div>

The `KeyError` means that the `GUROBI_HOME` environment was not set in the shell from which you started Julia. So just set it before starting Julia (probably just add the `export GUROBI_HOME=...` call to `~/.bash_profile` so it’s done automatically).

(See [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530) for how to properly format code in Discourse by the way).

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [September 12, 2023, 4:41pm UTC](https://discourse.julialang.org/t/install-gurobi-in-mac-juliapro/17580/5 "2023-09-12T16:41:36Z")

</div>


