0

I am relatively new to this, but I wanted to do my first steps using Python-MIP, so I just tried to follow the first examples. But every time a just want to create a model the following error occurs:

from mip import Model, BINARY
m = Model()

results in:

AttributeError                            Traceback (most recent call last)
Cell In[17], line 1
1 m = Model()

File ~\AppData\Roaming\Python\Python39\site-packages\mip\model.py:91, in Model.__init__(self, name, sense, solver_name, solver)
89     self.solver = mip.cbc.SolverCbc(self, name, sense)
90 else:
91     import mip.gurobi
93     if mip.gurobi.found:
95         self.solver = mip.gurobi.SolverGurobi(self, name, sense)

File ~\AppData\Roaming\Python\Python39\site-packages\mip\gurobi.py:75
72     lib_path = libfile[0]
74 # checking gurobi version
75 s1 = lib_path.split('"')[-1].split("/")[-1]
76 vs = [c for c in s1 if c.isdigit()]
77 major_ver = vs[0]

AttributeError: 'NoneType' object has no attribute 'split'

I just recently installed Gurobi but everything was fine so I cant find point what I am doing wrong here.

gusbro
  • 22,357
  • 35
  • 46
TOm_99
  • 25
  • 3
  • This looks like a bug in the `gurobi` package, or perhaps you have somehow managed to install it incorrectly. – tripleee Mar 20 '23 at 17:06
  • Damn, this doenst sound like there would be an easy solution. Gurobi itself works fine as far as I could see. Any suggestions on how to check for possible causes? – TOm_99 Mar 20 '23 at 17:21
  • I'm not familiar with the package so I can just see that it seems like it's supposed to work, but doesn't. Maybe approach the project maintainers with the intent of creating a support request or bug report. – tripleee Mar 20 '23 at 18:19

1 Answers1

1

Had the same problem some time ago. In my case Gurobi was not the reason, but the mip package. So reinstalling did it for me.