I am trying to run this example given in gurobi's example model. I am using python 3.5 with gurobi 7.0.2. When I run the code, I get the following error.
Traceback (most recent call last):
File "test.py", line 1, in <module>
from gurobipy import *
File "/if5/wua4nw/anaconda3/lib/python3.5/site-packages/gurobipy/__init__.py", line 1, in <module>
from .gurobipy import *
ImportError: libgurobi70.so: cannot open shared object file: No such file or directory
I have Gurobi installed at /if5/wua4nw/gurobi702
and I can see the required file libgurobi70.so
at /if5/wua4nw/gurobi702/linux64/lib/libgurobi70.so
. I am using Anaconda3 by the way.
I have seen this discussion but couldn't solve the problem yet. Can anyone shed some light so that I can solve the problem?
This problem [from .gurobipy import] is caused from the IDE Pycharm on Ubuntu. I am not sure if you may face it with the other IDEs . First You can make sure from the shell the python has gurobipy installed. after you installed from the file Gurobi ~\gurobi752\win64.
And add the libraries to the paths from the shell
gedit ~/.bashrc
. Then just run python from the shell as normal python commandpython yourFileName.py
and gurobi will works perfectlyIn windows 10 i added the path of gurobi to the IDE pycharm after
python setup.py install
and pip tool for gurobipy https://sites.google.com/site/pydatalog/python/pip-for-windows, then i added the path Settings->Project Interpreter-> show all -> interpreter paths -> add your gurobi pathI hope it works cheers ;)
I didn't notice the instructions in the official docs. Thanks to @sascha.
I followed the instructions and it solved my problem.