coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
525 stars 92 forks source link

Error using Gurobi Solver #118

Closed dapeipa closed 4 years ago

dapeipa commented 4 years ago
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/mip/gurobi.py", line 66, in <module>
    s1 = lib_path.split('"')[-1].split("/")[-1]
AttributeError: 'NoneType' object has no attribute 'split'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/example.py", line 4, in <module>
    m = Model("Ej1", solver_name=GRB)
  File "/home/dapeipa/.local/lib/python3.8/site-packages/mip/model.py", line 82, in __init__
    import mip.gurobi
  File "/home/dapeipa/.local/lib/python3.8/site-packages/mip/gurobi.py", line 93, in <module>
    raise ImportError
ImportError

Content .bashrc ... export GUROBI_HOME="opt/gurobi902/linux64" export PATH="${PATH}:/opt/gurobi902/linux64/bin" export LD_LIBRARY_PATH="/opt/gurobi902/linux64/lib"

h-g-s commented 4 years ago

Hi, Could you try set Gurobi_home starting with / ?

On Sun, 7 Jun 2020 at 13:54, dapeipa notifications@github.com wrote:

Traceback (most recent call last): File "/home/user/.local/lib/python3.8/site-packages/mip/gurobi.py", line 66, in s1 = lib_path.split('"')[-1].split("/")[-1] AttributeError: 'NoneType' object has no attribute 'split'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/example.py", line 4, in m = Model("Ej1", solver_name=GRB) File "/home/dapeipa/.local/lib/python3.8/site-packages/mip/model.py", line 82, in init import mip.gurobi File "/home/dapeipa/.local/lib/python3.8/site-packages/mip/gurobi.py", line 93, in raise ImportError ImportError

Content .bashrc ... export GUROBI_HOME="opt/gurobi902/linux64" export PATH="${PATH}:/opt/gurobi902/linux64/bin" export LD_LIBRARY_PATH="/opt/gurobi902/linux64/lib"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coin-or/python-mip/issues/118, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4VZOSCDVWR44PQH6NKRGDRVPA3XANCNFSM4NXNOBFQ .

--

Haroldo Gambini Santos Computing Department Universidade Federal de Ouro Preto - UFOP email: haroldo@ufop.edu.br home/research page: www.decom.ufop.br/haroldo

It has long been an axiom of mine that the little things are infinitely the most important. -- Sir Arthur Conan Doyle, "A Case of Identity"

dapeipa commented 4 years ago

Hi @h-g-s, thanks for your answer. Now it's working properly.