Closed torressa closed 1 year ago
I think the error comes because we needed to call some function of the gurobi python to know if it's correctly licensed. That's why we had gurobipy.setParam("_test", 0)
(this is the problematic line in question I'm guessing). Is there a way to check if a valid and licensed version of Gurobi is available without using a license? Or is there a way to return the license after successfully testing any random parameter? If the licensed is "single-use" I understand it's spent once we call it?
Sorry for all the questions but I checked the WIP and was overly complicated. If we can find a simple solution to check for licensing without using a license, that would be great.
Hi both, do we have any update on a fix for this?
right @pchtsp Seems we should call
Python: Gurobi 9.0.0 or newer: Call Model.dispose() on all Model objects. Then, if using custom-made environments, call Env.dispose() on all Env objects. Otherwise, call disposeDefaultEnv(). Gurobi 8.1.1 or older: Delete all Model objects, delete all Env objects (if used), then call disposeDefaultEnv().
@torressa and @Tomkourou are you able to test this by adding the line
gurobipy.disposeDefaultEnv()
after the line gurobipy.setParam("_test", 0)
Thanks, everyone. Sorry for the delay!
@torressa and @Tomkourou are you able to test this by adding the line gurobipy.disposeDefaultEnv()
That would work for this specific bug. In general, however, the current lack of environment handling still suffers from:
My commit https://github.com/torressa/pulp/commit/c766603fb1502acddc6af6e7cb51c4dfb5c17c6e addresses these points somewhat (still needs double checking).
Hi ! I'm still having the same issue. Any news on this ?
This has been merged. Will be fixed in the next release.
Details for the issue
What did you do?
Using a single-use token license.
Two tokens are required and not released until the python shell is exited (and the object is freed). So when you run the command again,
GUROBI
is no longer availableWhat did you expect to see?
What did you see instead?
Useful extra information
It would be good if environment handling was taken care of. This is an issue for Gurobi users using cloud, WLS or token license types. E.g. https://github.com/snakemake/snakemake/issues/1801
Possible solution: WIP:
What operating system are you using?
I'm using python version:
I installed PuLP via:
Did you also