AttributeError: NoneType' object has no attribute 'split' when creating a mip model

Question:

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 ~AppDataRoamingPythonPython39site-packagesmipmodel.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 ~AppDataRoamingPythonPython39site-packagesmipgurobi.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.

Asked By: TOm_99

||

Answers:

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.

Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.