cc_staff
1,857
edits
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: | ||
{{Commands|prompt=[name@server ~] $ | |||
| cat my_gurobi_script.py | |||
import pandas as pd | |||
import numpy as np | |||
import gurobipy as gurobi | |||
from gurobipy import * | |||
etc | |||
}} | |||
<!--T:126--> | <!--T:126--> | ||
Once created we can activate Gurobi | Once created we can activate our Gurobi environment at any time with: | ||
{{Commands|prompt=[name@server ~] $ | |||
| module load gurobi/9.0.1 | |||
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: | ||
{{File | {{File |