Can't install sage-numerical-backends-gurobi
AnsweredI'm trying to install sage-numerical-backends-gurobi with the command "sage -python -m pip install sage-numerical-backends-gurobi", but I get the following error:
ERROR: Command errored out with exit status 1:
command: /opt/sagemath-9.2/local/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tfjrz_p6/sage-numerical-backends-gurobi_94f82cc54df841f6b5b02b3b493c34b3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tfjrz_p6/sage-numerical-backends-gurobi_94f82cc54df841f6b5b02b3b493c34b3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-zabprplp
cwd: /tmp/pip-install-tfjrz_p6/sage-numerical-backends-gurobi_94f82cc54df841f6b5b02b3b493c34b3/
Complete output (43 lines):
GUROBI_HOME is not set, or it does not point to a directory with a Gurobi installation. Trying to link against -lgurobi
Checking whether HAVE_SAGE_CPYTHON_STRING...
Checking whether HAVE_ADD_COL_UNTYPED_ARGS...
Using compile_time_env: {'HAVE_SAGE_CPYTHON_STRING': True, 'HAVE_ADD_COL_UNTYPED_ARGS': True}
running bdist_wheel
running build
running build_py
creating build
creating build/lib.cygwin-3.1.7-x86_64-3.7
creating build/lib.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi
copying sage_numerical_backends_gurobi/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi
copying sage_numerical_backends_gurobi/gurobi_backend.pxd -> build/lib.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi
running build_ext
building 'sage_numerical_backends_gurobi.gurobi_backend' extension
creating build/temp.cygwin-3.1.7-x86_64-3.7
creating build/temp.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/python/python37/python37-3.7.7-1.x86_64/build=/usr/src/debug/python37-3.7.7-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/python/python37/python37-3.7.7-1.x86_64/src/Python-3.7.7=/usr/src/debug/python37-3.7.7-1 -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/python/python37/python37-3.7.7-1.x86_64/build=/usr/src/debug/python37-3.7.7-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/python/python37/python37-3.7.7-1.x86_64/src/Python-3.7.7=/usr/src/debug/python37-3.7.7-1 -I/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/cpython -I/opt/sagemath-9.2/local/lib/python3.7/site-packages/cysignals -I/opt/sagemath-9.2/local/lib/python3.7/site-packages -I/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/ext -I/usr/include/python3.7m -I/opt/sagemath-9.2/local/lib/python3.7/site-packages/numpy/core/include -IC:\Users\*****\win64/include -I/opt/sagemath-9.2/local/include -I/usr/include/python3.7m -c sage_numerical_backends_gurobi/gurobi_backend.c -o build/temp.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi/gurobi_backend.o
In file included from sage_numerical_backends_gurobi/gurobi_backend.c:648:
C:\Users\*****\win64/include/gurobi_c.h:25: warning: "__cdecl" redefined
25 | #define __cdecl
|
<built-in>: note: this is the location of the previous definition
In file included from sage_numerical_backends_gurobi/gurobi_backend.c:648:
C:\Users\*****\win64/include/gurobi_c.h:26: warning: "__stdcall" redefined
26 | #define __stdcall
|
<built-in>: note: this is the location of the previous definition
sage_numerical_backends_gurobi/gurobi_backend.c:13545:18: warning: ‘__pyx_pw_4sage_7cpython_6string_3str_to_bytes’ defined but not used [-Wunused-function]
13545 | static PyObject *__pyx_pw_4sage_7cpython_6string_3str_to_bytes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sage_numerical_backends_gurobi/gurobi_backend.c:13544:13: warning: ‘__pyx_doc_4sage_7cpython_6string_2str_to_bytes’ defined but not used [-Wunused-variable]
13544 | static char __pyx_doc_4sage_7cpython_6string_2str_to_bytes[] = "\n Convert ``str`` or ``unicode`` to ``bytes``.\n\n It encodes the given ``str`` to a Python 3 ``bytes``\n using the specified encoding. It is a no-op on ``bytes`` input.\n\n EXAMPLES::\n\n sage: from sage.cpython.string import str_to_bytes\n sage: bs = [str_to_bytes(u'\317\200')]\n sage: all(b == b'\\xcf\\x80' for b in bs)\n True\n sage: str_to_bytes([])\n Traceback (most recent call last):\n ...\n TypeError: expected str... list found\n ";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sage_numerical_backends_gurobi/gurobi_backend.c:13340:18: warning: ‘__pyx_pw_4sage_7cpython_6string_1bytes_to_str’ defined but not used [-Wunused-function]
13340 | static PyObject *__pyx_pw_4sage_7cpython_6string_1bytes_to_str(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sage_numerical_backends_gurobi/gurobi_backend.c:13339:13: warning: ‘__pyx_doc_4sage_7cpython_6string_bytes_to_str’ defined but not used [-Wunused-variable]
13339 | static char __pyx_doc_4sage_7cpython_6string_bytes_to_str[] = "\n Convert ``bytes`` to ``str``.\n\n This decodes the given ``bytes`` to a Python 3 unicode ``str`` using\n the specified encoding. It is a no-op on ``str`` input.\n\n EXAMPLES::\n\n sage: from sage.cpython.string import bytes_to_str\n sage: s = bytes_to_str(b'\\xcf\\x80')\n sage: s == u'\317\200'\n True\n sage: bytes_to_str([])\n Traceback (most recent call last):\n ...\n TypeError: expected bytes, list found\n ";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -shared -Wl,--enable-auto-image-base -L/opt/sagemath-9.2/local/lib -Wl,-rpath,/opt/sagemath-9.2/local/lib build/temp.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi/gurobi_backend.o -LC:\Users\*****\win64/lib -L/opt/sagemath-9.2/local/lib/python3.7/config -L/usr/lib -LC:\Users\*****\win64/lib -lgurobi -lpython3.7m -o build/lib.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi/gurobi_backend.cpython-37m-x86_64-cygwin.dll -lpari
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lgurobi
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for sage-numerical-backends-gurobi
Running setup.py clean for sage-numerical-backends-gurobi
Failed to build sage-numerical-backends-gurobi
Installing collected packages: sage-numerical-backends-gurobi
Running setup.py install for sage-numerical-backends-gurobi ... error
ERROR: Command errored out with exit status 1:
command: /opt/sagemath-9.2/local/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tfjrz_p6/sage-numerical-backends-gurobi_94f82cc54df841f6b5b02b3b493c34b3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tfjrz_p6/sage-numerical-backends-gurobi_94f82cc54df841f6b5b02b3b493c34b3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-o3p7kq7j/install-record.txt --single-version-externally-managed --compile --install-headers /opt/sagemath-9.2/local/include/site/python3.7/sage-numerical-backends-gurobi
cwd: /tmp/pip-install-tfjrz_p6/sage-numerical-backends-gurobi_94f82cc54df841f6b5b02b3b493c34b3/
Complete output (43 lines):
GUROBI_HOME is not set, or it does not point to a directory with a Gurobi installation. Trying to link against -lgurobi
Checking whether HAVE_SAGE_CPYTHON_STRING...
Checking whether HAVE_ADD_COL_UNTYPED_ARGS...
Using compile_time_env: {'HAVE_SAGE_CPYTHON_STRING': True, 'HAVE_ADD_COL_UNTYPED_ARGS': True}
running install
running build
running build_py
creating build
creating build/lib.cygwin-3.1.7-x86_64-3.7
creating build/lib.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi
copying sage_numerical_backends_gurobi/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi
copying sage_numerical_backends_gurobi/gurobi_backend.pxd -> build/lib.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi
running build_ext
building 'sage_numerical_backends_gurobi.gurobi_backend' extension
creating build/temp.cygwin-3.1.7-x86_64-3.7
creating build/temp.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/python/python37/python37-3.7.7-1.x86_64/build=/usr/src/debug/python37-3.7.7-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/python/python37/python37-3.7.7-1.x86_64/src/Python-3.7.7=/usr/src/debug/python37-3.7.7-1 -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/python/python37/python37-3.7.7-1.x86_64/build=/usr/src/debug/python37-3.7.7-1 -fdebug-prefix-map=/cygdrive/d/cyg_pub/devel/python/python37/python37-3.7.7-1.x86_64/src/Python-3.7.7=/usr/src/debug/python37-3.7.7-1 -I/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/cpython -I/opt/sagemath-9.2/local/lib/python3.7/site-packages/cysignals -I/opt/sagemath-9.2/local/lib/python3.7/site-packages -I/opt/sagemath-9.2/local/lib/python3.7/site-packages/sage/ext -I/usr/include/python3.7m -I/opt/sagemath-9.2/local/lib/python3.7/site-packages/numpy/core/include -IC:\Users\*****\win64/include -I/opt/sagemath-9.2/local/include -I/usr/include/python3.7m -c sage_numerical_backends_gurobi/gurobi_backend.c -o build/temp.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi/gurobi_backend.o
In file included from sage_numerical_backends_gurobi/gurobi_backend.c:648:
C:\Users\*****\win64/include/gurobi_c.h:25: warning: "__cdecl" redefined
25 | #define __cdecl
|
<built-in>: note: this is the location of the previous definition
In file included from sage_numerical_backends_gurobi/gurobi_backend.c:648:
C:\Users\*****\win64/include/gurobi_c.h:26: warning: "__stdcall" redefined
26 | #define __stdcall
|
<built-in>: note: this is the location of the previous definition
sage_numerical_backends_gurobi/gurobi_backend.c:13545:18: warning: ‘__pyx_pw_4sage_7cpython_6string_3str_to_bytes’ defined but not used [-Wunused-function]
13545 | static PyObject *__pyx_pw_4sage_7cpython_6string_3str_to_bytes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sage_numerical_backends_gurobi/gurobi_backend.c:13544:13: warning: ‘__pyx_doc_4sage_7cpython_6string_2str_to_bytes’ defined but not used [-Wunused-variable]
13544 | static char __pyx_doc_4sage_7cpython_6string_2str_to_bytes[] = "\n Convert ``str`` or ``unicode`` to ``bytes``.\n\n It encodes the given ``str`` to a Python 3 ``bytes``\n using the specified encoding. It is a no-op on ``bytes`` input.\n\n EXAMPLES::\n\n sage: from sage.cpython.string import str_to_bytes\n sage: bs = [str_to_bytes(u'\317\200')]\n sage: all(b == b'\\xcf\\x80' for b in bs)\n True\n sage: str_to_bytes([])\n Traceback (most recent call last):\n ...\n TypeError: expected str... list found\n ";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sage_numerical_backends_gurobi/gurobi_backend.c:13340:18: warning: ‘__pyx_pw_4sage_7cpython_6string_1bytes_to_str’ defined but not used [-Wunused-function]
13340 | static PyObject *__pyx_pw_4sage_7cpython_6string_1bytes_to_str(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sage_numerical_backends_gurobi/gurobi_backend.c:13339:13: warning: ‘__pyx_doc_4sage_7cpython_6string_bytes_to_str’ defined but not used [-Wunused-variable]
13339 | static char __pyx_doc_4sage_7cpython_6string_bytes_to_str[] = "\n Convert ``bytes`` to ``str``.\n\n This decodes the given ``bytes`` to a Python 3 unicode ``str`` using\n the specified encoding. It is a no-op on ``str`` input.\n\n EXAMPLES::\n\n sage: from sage.cpython.string import bytes_to_str\n sage: s = bytes_to_str(b'\\xcf\\x80')\n sage: s == u'\317\200'\n True\n sage: bytes_to_str([])\n Traceback (most recent call last):\n ...\n TypeError: expected bytes, list found\n ";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -shared -Wl,--enable-auto-image-base -L/opt/sagemath-9.2/local/lib -Wl,-rpath,/opt/sagemath-9.2/local/lib build/temp.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi/gurobi_backend.o -LC:\Users\*****\win64/lib -L/opt/sagemath-9.2/local/lib/python3.7/config -L/usr/lib -LC:\Users\*****\win64/lib -lgurobi -lpython3.7m -o build/lib.cygwin-3.1.7-x86_64-3.7/sage_numerical_backends_gurobi/gurobi_backend.cpython-37m-x86_64-cygwin.dll -lpari
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lgurobi
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/sagemath-9.2/local/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tfjrz_p6/sage-numerical-backends-gurobi_94f82cc54df841f6b5b02b3b493c34b3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tfjrz_p6/sage-numerical-backends-gurobi_94f82cc54df841f6b5b02b3b493c34b3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-o3p7kq7j/install-record.txt --single-version-externally-managed --compile --install-headers /opt/sagemath-9.2/local/include/site/python3.7/sage-numerical-backends-gurobi Check the logs for full command output.
It says "GUROBI_HOME is not set, or it does not point to a directory with a Gurobi installation", but that's not true.
-
Could you please try executing gurobi_cl in a terminal window? If it is not found, you have to install the full Gurobi package first, see our Quick Start Guides. You will also require a valid license, see Retrieving a Free Academic License.
Maybe the instructions provided in the documentation of the sage-numerical-backends-gurobi project may help.
Best regards,
Jaromił0 -
The command outputs the following:
"Academic license - for non-commercial use only - expires 2021-10-16
Using license file C:\Users\*****\gurobi.lic
Set parameter LogFile to value gurobi.logUsage: gurobi_cl [--command]* [param=value]* filename
Type 'gurobi_cl --help' for more information."That documentation I have seen. I'm working with Windows so I skipped the "Installation of Gurobi" part. To install the package I tried the first two commands. The first command prints thousands of times
"make[1]: Entering directory '/opt/sagemath-9.2'
make build/make/Makefile --stop"and just increases the number of make. The second command leads to the error I posted.
0 -
From the Github of sage-numerical-backends-gurobi it does not look like this Python package is compatible with Windows. At least there is no mentioning of any installation steps for Windows machines. If possible, you should try installing it on a Linux machine.
Best regards,
Jaromił1 -
Thank you. I‘m using now WSL. There works everything well, except that the pathes are not saved after closing it. But that‘s no problem for me.
0
Please sign in to leave a comment.
Comments
4 comments