question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`GUROBI_HOME` check does not work with pip installation of Gurobi

See original GitHub issue

Describe the bug If Gurobi is installed via pip (see e.g. here), then the .so file does not conform to the current style set out in mip/gurobi.py.

To Reproduce

  1. pip install mip
  2. pip install -i https://pypi.gurobi.com gurobipy
  3. `setenv GUROBI_HOME=‘xxx’
  4. It doesn’t work

Expected behavior I think it would be nice if it happened.

Desktop (please complete the following information):

  • Operating System, version: Linux [note: this does not happen under Mac]
  • Python version: 3.7
  • Python-MIP version (we recommend you to test with the latest version): latest

Additional context I think a possible fix would look like this, i.e. to add this after the first is not libfile:

if not libfile: # For pip installer
            libfile = glob(
                os.path.join(os.environ["GUROBI_HOME"], "gurobipy.*.so")
            )

For Linux, the .so file is named: gurobipy.cpython-37m-x86_64-linux-gnu.so. This would though mean that the version number deduction with major_ver and minor_ver in gurobi.py does not work and the subsequent definition of lib_path does not work either. Not sure how to handle this, which is why I did not make a PR.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
RichardOberdieckcommented, Mar 25, 2022

Yes, this is unfortunately to be expected since the trial license only works for gurobipy or our command-line interface (gurobi_cl); it will not work with any other API, including the C API.

I will ask internally whether we can change this, and will let you know if I hear anything back.

0reactions
DavidWalzcommented, May 24, 2022

A workaround for windows is to copy the gurobiXX.dll file inside a folder called /bin because of this line https://github.com/coin-or/python-mip/blob/14466736d92ea13182d18c61c64642aff4a5a2e8/mip/gurobi.py#L55

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I install Gurobi for Python?
Pip is the standard way of installing Python packages and should work on most platforms and systems. Use this command to install a...
Read more >
How do I resolve common installation issues with the Gurobi ...
Outline of the video: Introduction ModuleNotFoundError: No module named 'gurobipy' gurobipy.GurobiError: Model too large for...
Read more >
How do I resolve the error "No module named 'gurobipy'"?
Ensure that you have installed the Gurobi Python Interface, gurobipy. This is a separate step from installing the Gurobi Optimizer package.
Read more >
How do I resolve the error "grbgetkey: command not found" or ...
Ensure Gurobi is already installed on your system. Note: The Gurobi pip installation method does not provide Gurobi license tools. In order to ......
Read more >
Google Colab: Installation and Licensing - Gurobi Support Portal
Usage Limit Issues; Using a Local Runtime; Gurobi + Colab for Teaching. Installation. To use Gurobi in a Colab notebook, you will first...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found