Failed to create Gurobi environment

1,887 views
Skip to first unread message

Stewart

unread,
Dec 1, 2011, 10:35:58 PM12/1/11
to Gurobi Optimization
Hi,

I just downloaded Gurobi today to use with Python. I run windows 7 64
bit. I code with Eclipse
with the pydev plug-in. I'm a UC Berkeley graduate student and I
obtained
and installed the academic license following the steps posted on the
Gurobi website. Now I'm getting the error: Failed to create Gurobi
environment. Can you see any possible reasons that this happened?

I really appreciate your time!

-Stewart

Louie

unread,
Dec 2, 2011, 8:06:13 PM12/2/11
to Gurobi Optimization
Does the Gurobi interactive shell work?
If not, there may be an issue with the license.
If yes, try running Python from terminal and importing Gurobi there.
Is there any more to the error message?

Stewart

unread,
Dec 6, 2011, 2:55:21 PM12/6/11
to gur...@googlegroups.com
The Gurobi shell also returns the same error, the complete error message is as follows:

Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.

ERROR: No Gurobi license found (user, host, hostid)

Traceback (most recent call last):
  File "E:\Cal\Software\gurobi460\win64\lib\gurobi.py", line 5, in <module>
    from gurobipy import *
  File "E:\Cal\Software\gurobi460\win64\python27\lib\gurobipy\__init__.py", line
 1, in <module>
    from gurobipy import *
  File "gurobi.pxi", line 12, in init gurobipy (../../src/python/gurobipy.c:58508)
ImportError: Failed to create Gurobi environment

I do see the gurobi license file, is there a specific place I should put the file?

Greg Glockner

unread,
Dec 6, 2011, 2:58:40 PM12/6/11
to gur...@googlegroups.com
> I do see the gurobi license file, is there a specific place I should put the file?

See FAQ 1:

http://www.gurobi.com/html/techfaq.html

Stewart

unread,
Dec 6, 2011, 3:04:26 PM12/6/11
to gur...@googlegroups.com
I read that before but I don't understand how to "Set the environment variable GRB_LICENSE_FILE to point to the exact location of the file." Where do I find this variable?

Greg Glockner

unread,
Dec 6, 2011, 4:11:08 PM12/6/11
to gur...@googlegroups.com

Stewart

unread,
Dec 6, 2011, 4:53:15 PM12/6/11
to gur...@googlegroups.com
I'm running win7, when I type "set" in the command prompt, the variable name GUROBI_LICENSE_FILE is not in the list of environment variables. How do I proceed?


On Tue, Dec 6, 2011 at 1:11 PM, Greg Glockner <gloc...@gurobi.com> wrote:
See:

http://en.wikipedia.org/wiki/Environment_variable


Stewart

unread,
Dec 7, 2011, 7:26:18 PM12/7/11
to gur...@googlegroups.com
so sorry to bother you guys again! Can anyone help me out?

To summarize my situation:
I'm running windows 7, I've installed Gurobi and activated the academic license using the "grbgetkey" command.
I can see the license file, but there isnt an environment variable named "GUROBI_LICENCE_FILE" in my system.
When I run gurobi, it throws the "No Gurobi Licence Found" and "cannot create gurobi environment" error

Can anyone help me out? Really appreciate your time!

Stuart Mitchell

unread,
Dec 7, 2011, 7:51:04 PM12/7/11
to gur...@googlegroups.com
Try this

http://lmgtfy.com/?q=how+to+change+an+environment+variable+windows+7

Stu

--
Stuart Mitchell
PhD Engineering Science
Freelance Programmer and Optimisation Expert
www.stuartmitchell.com

rlin...@gmail.com

unread,
Dec 8, 2011, 6:04:28 AM12/8/11
to gur...@googlegroups.com
On Thu, Dec 8, 2011 at 1:26 AM, Stewart <stewa...@gmail.com> wrote:
> When I run gurobi, it throws the "No Gurobi Licence Found" and "cannot
> create gurobi environment" error

put the gurobi.lic (the license file) in c:\gurobi460\

Reply all
Reply to author
Forward
0 new messages