Note: These instructions have been updated to use the setup.py from the Gurobi distribution.
- The shell is Python, which is good. However, instead of bundling the Gurobi libraries as a Python module that I can install alongside my system's native Python, they ship their own Python binaries. If I want to use any third-party modules I have to make them available to Gurobi somehow.
- They appear to have removed distutils from the Python they ship.
- The Gurobi shell doesn't give me module docs, tab completion, or anything I'd get from either ipython or bpython. It's nothing more than the rudimentary cPython shell.
They do, however, provide a setup.py script, so we don't have to use gurobi.sh or the Python that's in the distribution. Here are simple instructions for using bpython as your shell. You should have Gurobi 5.0.1 installed and the GUROBI_HOME environment variable set. (I assume you are installing it into your home directory.)
$ mkdir -p $HOME/lib/python2.7/site-packages/ $ cd $GUROBI_HOME $ PYTHONPATH=$HOME/lib/python2.7/site-packages/ python setup.py install --prefix=$HOME
Update your environment's PYTHONPATH and LD_LIBRARY_PATH:
$ echo "export PYTHONPATH=\$PYTHONPATH:\$HOME/lib/python2.7/site-packages/" >> $HOME/.bashrc $ echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$GUROBI_HOME/lib/" >> $HOME/.bashrc $ source $HOME/.bashrc
$ sudo apt-get install bpython
Now type bpython and you should have the lovely interface you see below, complete with tab completion and module docs. Isn't that better?