step1.
去官网下载gurobi,网址:http://www.gurobi.com/downloads/gurobi-optimizer
用教育版邮箱注册,下载软件并获得license(一个序列号) Named-User Academic
step2:
解压下载的文件,命令如下:
tar xvfz gurobi8.1.0_linux64.tar.gz
step3:
设置环境变量,在~/.bashrc中添加以下部分,注意这部分"/home/hadoop/Downloads/"修改成自己的目录
export GUROBI_HOME=/home/hadoop/Downloads/gurobi810/linux64
export PATH={GUROBI_HOME}/bin
export LD_LIBRARY_PATH={GUROBI_HOME}/lib
step4:
在官网获取授权的key(学生可以免费得到),网址:https://user.gurobi.com/download/licenses/free-academic
step5:
进入解压好的gurobi文件夹下,通过step3得到的key进行激活
./gurobi810/linux64/bin/grbgetkey xxxxxxx //注意文件目录,grbgetkey xxxxxxx则是通过step3得到的
step6:
验证是否成功,终端输入
gurobi.sh
export GRB_LICENSE_FILE=/home/wust/license/gurobi.lic
gurobi.sh
Python 2.7.13 (default, Sep 4 2017, 15:40:17)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Academic license - for non-commercial use only
Gurobi Interactive Shell (linux64), Version 8.1.0
Copyright (c) 2018, Gurobi Optimization, LLC
Type "help()" for help
gurobi>