Gurobi: Difference between revisions

Jump to navigation Jump to search
3 bytes added ,  3 months ago
no edit summary
No edit summary
No edit summary
Line 218: Line 218:
|  pip install --no-index  pandas
|  pip install --no-index  pandas
}}
}}
Next install gurobipy into the environment. As mentioned above and in [[https://support.gurobi.com/hc/en-us/articles/360044290292-How-do-I-install-Gurobi-for-Python|this article]] the use of setup.py to install Gurobi for python is deprecated starting with Gurobi 11.  Both pip and conda are given as alternatives; however, since conda should not be used on alliance systems, the pip approach will be demonstrated here. The installation of gurobipy is slightly complicated since our Linux systems are set up with gentoo prefix.  As a result neither A) the recommended command to download and install the gurobipy extension from the public PyPI server <code>pip install gurobipy==11.0.1</code> mentioned in the article line or B) the offline command to install the wheel with <code>python -m pip install --find-links <wheel-dir> --no-index gurobipy</code>, will work.  Instead a script available from the alliance maybe utilized to download and simultaneously convert the existing wheel into a usable format with a new name.  There is one caveat, for each new Gurobi version the researcher must go into https://pypi.org/project/gurobipy/11.0.1/#history and click on the desired version followed by the <code>Download files</code> button located in the menu on the left.  Finally click to copy the https link for the wheel file (named gurobipy-11.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl in the case of Gurobi 11.0.1) and paste it as the --url argument as shown below :
Next install gurobipy into the environment. As mentioned above and in [[https://support.gurobi.com/hc/en-us/articles/360044290292-How-do-I-install-Gurobi-for-Python|this article]] the use of setup.py to install Gurobi for python is deprecated starting with Gurobi 11.  Both pip and conda are given as alternatives; however, since conda should not be used on alliance systems, the pip approach will be demonstrated here. The installation of gurobipy is slightly complicated since our Linux systems are set up with gentoo prefix.  As a result neither A) the recommended command to download and install the gurobipy extension from the public PyPI server <code>pip install gurobipy==11.0.1</code> mentioned in the article line or B) the offline command to install the wheel with <code>python -m pip install --find-links <wheel-dir> --no-index gurobipy</code>, will work.  Instead a script available from the alliance maybe utilized to download and simultaneously convert the existing wheel into a usable format with a new name.  There is one caveat, for each new Gurobi version the researcher must go into https://pypi.org/project/gurobipy/11.0.1/#history and click on the desired version followed by the <code>Download files</code> button located in the menu on the left.  Finally, click to copy the https link for the wheel file (named gurobipy-11.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl in the case of Gurobi 11.0.1) and paste it as the --url argument as shown below :


<!--T:112-->
<!--T:112-->
Line 235: Line 235:


<!--T:126-->
<!--T:126-->
Once created our Gurobi environment can be actived and used at any time.  To demonstrate this we also load gurobi (so $EBROOTGUROBI is defined) and <code>scipy-stack</code> (so scipy is available).  Both are required to run the matrix example (along with numpy that was already installed into our  environment with pip in a previous step above via pandas).
Once created our Gurobi environment can be activated and used at any time.  To demonstrate this we also load gurobi (so $EBROOTGUROBI is defined) and <code>scipy-stack</code> (so scipy is available).  Both are required to run the matrix example (along with numpy that was already installed into our  environment with pip in a previous step above via pandas).


<!--T:203-->
<!--T:203-->
rsnt_translations
56,430

edits

Navigation menu