ImportError: No module named gurobipy

5,036 views
Skip to first unread message

Maximilian Loosen

unread,
Nov 10, 2014, 6:27:27 AM11/10/14
to gur...@googlegroups.com
Hi everyone,
I am using OSX Yosemite + the latest versions of Gurobi, Python 2.7.8 and Pycharm 3.4.

When I am using this configuration on my MacBook everything is working fine, but when I installed exactly the same applications on my Mac I get an ImportError: No module named gurobipy

Your help is greatly appreciated

Watson, Jean-Paul

unread,
Nov 10, 2014, 4:23:03 PM11/10/14
to gur...@googlegroups.com
It looks like gurobi is not properly installed. Maybe. 

Assuming you did “pip install coopr” and did not create a virtualized python environment…

Can you simple try to bring up the python interpreter and type “import gurobipy”? I suspect you should have the same problem there.

I know Gurobi is somewhat sensitive to the python version on MacOS. In any case, please report the results of the experiment indicated above.

jpw

--

---
You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maximilian Loosen

unread,
Nov 11, 2014, 5:09:24 AM11/11/14
to gur...@googlegroups.com
Yeah I get the error when trying to import gurobipy.
When I type "import gurobipy" in the python shell the shell stops working and I get an "Python quit unexpectedly." error.

I just downloaded the Mac OSX gurobi installer and registered it with the license command.

What do you mean with "virtualized python environment" ?

Thank you for your help 

Sonja Mars

unread,
Nov 11, 2014, 11:25:36 AM11/11/14
to gur...@googlegroups.com
Hi,

First of all please note that Gurobi Optimizer uses the default Apple Python (/usr/bin/python), currently in Yosemite version 2.7.6. We do not support other Python distributions including those from python.org.

Additionally, for installing Gurobi in your own Python distribution for example on a linux machine you need to follow the instructions here: http://www.gurobi.com/documentation/5.6/quick-start-guide/the_gurobi_python_interfac

Best regards,
Sonja

-----------------------------------------------------------------
Dr. Sonja Mars
Gurobi Optimization





01543627906436788

unread,
Nov 11, 2014, 5:47:39 PM11/11/14
to gur...@googlegroups.com
Pycharm installs another version of python.
Go to Preferences > Python Interpreter and Select Version 2.7.6

Morgan Rodgers

unread,
Nov 13, 2014, 8:42:43 PM11/13/14
to gur...@googlegroups.com
Have you remembered to install the Gurobi model into python (by running the setup.py script from the Gurobi install directory)?

I have Gurobi running fine with Python 2.7.8 under Mavericks (the python.org version), I made sure I followed these steps so that it was the proper version in /usr/bin/)
seems there are some issues with ending up with multiple python installs...
Reply all
Reply to author
Forward
0 new messages