1. Modifications required for gurobi

add following to ~/.bash_profile

export GUROBI_VERSION=950
export GRB_LICENSE_FILE=/opt/gurobi/latest/linux64/gurobi-client.lic

2. Create Python Virtual environment using gurobi.

Python 3

python -m venv gurobi-env
source ./gurobi-env/bin/activate
pip3 install gurobipy
pip3 install --upgrade pip
pip3 install pandas
pip3 install numpy
pip3 install xlsxwriter
pip3 install xlrd
deactivate

3. Create wrapper shell script to run python script (test.sh)

!/usr/bin/env bash

source ./gurobi-env/bin/activate
python m2.py
deactivate

4. Sample HTCondor command file (py3.cmd)

universe = vanilla
getenv = true
executable = test.sh
output = $ENV(HOME)/$(Cluster).$(process).out
error = $ENV(HOME)/$(Cluster).$(process).error
log = $ENV(HOME)/$(Cluster).log
queue

5. Submitting job to HTCondor

condor_submit py3.cmd