Gurobi: Difference between revisions

Jump to navigation Jump to search
112 bytes added ,  3 years ago
m
no edit summary
mNo edit summary
mNo edit summary
Line 204: Line 204:
Python scripts can now import both Pandas and Gurobi:
Python scripts can now import both Pandas and Gurobi:


import pandas as pd
{{Commands|prompt=[name@server ~] $
import numpy as np
| cat my_gurobi_script.py
import gurobipy as gurobi
  import pandas as pd
from gurobipy import *
  import numpy as np
  # [...]
  import gurobipy as gurobi
  from gurobipy import *
  etc
  }}


<!--T:126-->
<!--T:126-->
Once created we can activate Gurobi and the environment with:
Once created we can activate our Gurobi environment at any time with:


module load gurobi/9.0.1
{{Commands|prompt=[name@server ~] $
source ~/env_gurobi/bin/activate
| module load gurobi/9.0.1
python my_gurobi_script.py
  source ~/env_gurobi/bin/activate
  (env_gurobi) python my_gurobi_script.py
}}


<!--T:130-->
<!--T:130-->
Note that we now use <code>python</code> instead of <code>gurobi.sh</code>!
Note that we now use <code>python</code> instead of <code>gurobi.sh</code>! This is an example job script that we can use:
 
<!--T:132-->
And this is an example job script that we can use:


{{File
{{File
cc_staff
1,857

edits

Navigation menu