Gurobi backend problem

asked 2021-02-13 10:28:35 +0100

Grabol gravatar image

updated 2021-02-14 01:09:32 +0100

slelievre gravatar image

Hello, I am trying to attach gurobi backend to my sage. I downloaded gurobi and its licence, I can use it in cmd but I found no guide on how to use it with sage on Windows 10, which i am currently using. I used guide for Linux from and I tried different approaches. I decided to download gurobi in my sage shell in /opt/ folder, I exported all neccessary variables but after running i get this error: line 17: /opt/gurobi911/linux64//bin/python3.7: cannot execute binary file: Exec format error Is my approach correct? How can I achieve my goal? Thanks in advance.

edit retag flag offensive close merge delete


Do you use :

  • The Cygwin port of Sage installed by The sagemath installer ?

  • A Linux virtual machine running Sagemath ?

  • A WSL port of Sagemath ?

This changes what you can and cannot do with Sagemath...

I downloaded gurobi and its licence, I can use it in cmd

So your gurobi binary is a Windows executable, right ? line 17: /opt/gurobi911/linux64//bin/python3.7: cannot execute binary file: Exec format error

I doubt that Cygwin or a Linux virtual machine can execute a Windows executable starting from an (unmodified) Linux scipt or rogram). WSL might start a Windows executable from its command line or bash script.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2021-02-13 15:04:36 +0100 )edit

I use Cygwin port of Sage which I installed by sagemath binary.

Excactly, my Gurobi binary is Windows .exe file.

I tried downloading Linux version of Gurobi and using it on Cygwin console, getting this bug that I gave after calling

As I understand I need to download pip package for gurobi backend which is done by sage -python -m pip install sage-numerical-backends-gurobi. After running this command for the first time i got bug that my GUROBI_HOME env variable is not set, but after I set it properly this command errors with: * ERROR: Command errored out with exit status 1: command: /opt/sagemath-9.2/local/bin/python3 -u -c 'import sys, setuptools, tokenize;...*

Is there any way to use Gurobi with Sage on Windows or is Linux mandatory for this?

Grabol gravatar imageGrabol ( 2021-02-13 18:30:25 +0100 )edit