Skip to content

Conversation

@Crissal1995
Copy link

@Crissal1995 Crissal1995 commented Jun 18, 2019

I've come across a bug; on Linux (but I think it's multi os) I installed only mip and, when launching my script using it, I got a NameError: name 'ffi' is not defined.
I searched where the problem was (line 264 of gurobi.py file, called in line 485 of model.py __init__), tried to fix it, but the problem was that in the first try except block ffi was initializated AFTER the raise of exception (going into the except block), causing the has_gurobi to be False and ffi to not exist in the workspace.
TL;DR setting the solver_name to cbc (the one that comes included with installation btw) there isn't any problem and everything works

I've come across a bug; on Linux (but I think it's multi os) I installed only mip and, when launching my script using it, I got a NameError: name 'ffi' is not defined. 
I searched where the problem was (line 264 of gurobi.py file, called in line 485 of model.py __init__), tried to fix it, but the problem was that in the first try except block ffi was initializated AFTER the raise of exception (going into the except block), causing the has_gurobi to be False and ffi to not exist in the workspace.
TL;DR setting the solver_name to cbc (the one that comes included with installation btw) there isn't any problem and everything works
@h-g-s
Copy link
Contributor

h-g-s commented Jun 18, 2019 via email

@tkralphs
Copy link
Member

If you look at the fork, the parent commit to the PR is d88a1da, which is 1.3.

@Crissal1995
Copy link
Author

Crissal1995 commented Jun 18, 2019

Hi, are you using the last Python-MIP version (1.3) ? I think that in previous versions cffi was not included as a dependency, not it is and I think that installing it will also install cffi. Could you check it ?

Yes, I'm using the lastest MIP version.
I noticed that with my PR gurobi won't be ever selected (because solver_name is always equal to cbc), so instead I think it's better to raise an exception into gurobi.py in the except section (after has_gurobi = False)


EDIT
By the way MIP is working great with Gurobi installed (mip will find and use gurobi), but this problem is showing with only mip installed

@h-g-s
Copy link
Contributor

h-g-s commented Jun 18, 2019 via email

@Crissal1995
Copy link
Author

You're welcome!

@Crissal1995 Crissal1995 deleted the patch-1 branch June 20, 2019 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants