`GUROBI_HOME` check does not work with pip installation of Gurobi
See original GitHub issueIssue Description
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
pip install mip
pip install -i https://pypi.gurobi.com gurobipy
- `setenv GUROBI_HOME=‘xxx’
- 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:
- Created 2 years ago
- Comments:9
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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