Skip to content

GUROBI_HOME check does not work with pip installation of Gurobi #185

@RichardOberdieck

Description

@RichardOberdieck

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.

Metadata

Metadata

Assignees

Labels

gurobiAll items related to gurobi

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions