Gurobi/fr: Difference between revisions

Jump to navigation Jump to search
417 bytes removed ,  3 months ago
no edit summary
(Created page with "=== Versions Gurobi 11.0.0 (et plus récentes) ===")
No edit summary
Line 209: Line 209:
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 Alliance linux systems are setup 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 an 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 left hand menu.  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 Alliance linux systems are setup 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 an 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 left hand menu.  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 :


<div class="mw-translate-fuzzy">
{{Commands|prompt=(env_gurobi) [name@server ~] $
{{Commands|prompt=(env_gurobi) [name@server ~] $
| cd $EBROOTGUROBI
| wget https://raw.githubusercontent.com/ComputeCanada/wheels_builder/main/unmanylinuxize.sh
| python setup.py build --build-base /tmp/${USER} install
| chmod u+rx unmanylinuxize.sh
  running build
| ./unmanylinuxize.sh --package gurobipy --version 11.0.1 --url
  running build_py
https://files.pythonhosted.org/packages/1c/96/4c800e7cda4a1688d101a279087646912cf432b0f61ff5c816f0bc8503e0/gurobipy-11.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
  creating /tmp/name
| ls
  creating /tmp/name/lib
gurobipy-11.0.1-cp311-cp311-linux_x86_64.whl  unmanylinuxize.sh
  creating /tmp/name/lib/gurobipy
| python -m pip install --find-links $PWD --no-index gurobipy
  copying lib/python3.7_utf32/gurobipy/__init__.py -> /tmp/name/lib/gurobipy
| deactivate
  copying lib/python3.7_utf32/gurobipy/gurobipy.so -> /tmp/name/lib/gurobipy
[name@server ~]}}
  running install
  running install_lib
  creating /home/name/env_gurobi/lib/python3.7/site-packages/gurobipy
  copying /tmp/name/lib/gurobipy/gurobipy.so -> /home/name/env_gurobi/lib/python3.7/site-packages/gurobipy
  copying /tmp/name/lib/gurobipy/__init__.py -> /home/name/env_gurobi/lib/python3.7/site-packages/gurobipy
  byte-compiling /home/name/env_gurobi/lib/python3.7/site-packages/gurobipy/__init__.py to __init__.cpython-37.pyc
  running install_egg_info
  Writing /home/name/env_gurobi/lib/python3.7/site-packages/gurobipy-9.0.1-py3.7.egg-info
| cd
}}
</div>


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
rsnt_translations
56,430

edits

Navigation menu