Gurobi in Python

869 views
Skip to first unread message

Justin O'Pella

unread,
Aug 10, 2017, 2:45:00 PM8/10/17
to Gurobi Optimization
Hi,
I have downloaded Gurobi and am able to run and solve small problems in a terminal. However, I am receiving the ' No Module name gurobipy' when I try to import Gurobi into python. I have used the "import gurobipy" command as well as the "from gurobi import *". I realize this question may have been asked before but this area is not my expertise. For reference, below is the Python version I am using and I am operating on MacOS Sierra. Any feedback is greatly appreciated. Thanks.

Python 2.7.13 |Anaconda 4.4.0 (x86_64)| (default, Dec 20 2016, 23:05:08) 

[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

Anaconda is brought to you by Continuum Analytics.

Please check out: http://continuum.io/thanks and https://anaconda.org

Sonja Mars

unread,
Aug 14, 2017, 2:43:02 AM8/14/17
to gur...@googlegroups.com
Hi,


To install Gurobi into Anaconda Python (which is what you are using). Please take a look at this page:

http://www.gurobi.com/documentation/7.5/quickstart_mac/installing_the_anaconda_py.html

Best regards,
Sonja


----
Dr. Sonja Mars
Gurobi Optimization - Technical Support



Justin O'Pella

unread,
Aug 14, 2017, 9:43:38 AM8/14/17
to Gurobi Optimization
I am met with this response when I enter the command:

SyntaxError: invalid syntax

>>> conda config -add channels http://conda.anaconda.org/gurobi

  File "<stdin>", line 1

    conda config -add channels http://conda.anaconda.org/gurobi

               ^

Rodrigo Mosconi

unread,
Aug 14, 2017, 9:58:43 AM8/14/17
to gur...@googlegroups.com
could you try to use the conda command on MacOS shell, not in the pyhton shell?

--

---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin O'Pella

unread,
Aug 22, 2017, 8:34:04 AM8/22/17
to Gurobi Optimization
FYI- to circle back on this and to possibly help anyone else: the issue was I did not have admin rights on the device I was using so I was unable to install the package in the correct spot for python to retrieve it but I have resolved.
To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages