error in pycharm
AnsweredI see this error in pycharm
/usr/bin/python3.6 "/home/bu/chunche.py"
Traceback (most recent call last):
File "/home/bu/chunche.py", line 1, in <module>
from gurobipy import *
File "/usr/local/lib/python3.6/dist-packages/gurobipy/__init__.py", line 1, in <module>
from .gurobipy import *
ImportError: libgurobi81.so: cannot open shared object file: No such file or directory
but if i run chunche.py from terminal there are no errors
bu@bu:~$ python3 chunche.py
bu@bu:~$
-
Hi,
We have a knowledge base article about this topic. Have you already looked at it?
Best regards,
Sonja
-1 -
It seems that PyCharm is not picking up settings from your terminal set through ".bashrc" as explained in Gurobi documentation. So although you might be able to solve it from terminal, even terminal inside PyCharm, it will not work if you want to run it using configuration. What worked for me was to set "LD_LIBRARY_PATH=/opt/gurobi811/linux64/lib" in Environment Variables part of Configuration. I needed to pass a full path as substitution does not seem to work either.
I am using Anaconda with Python 3.7 and in this specific instance I created virtual environment using "python3 -m --system-site-packages venv_gurobi"
0 -
Just writing to confirm what Grzegorz said - setting "LD_LIBRARY_PATH=/opt/gurobi903/linux64/lib" solved this problem for me.
I had otherwise followed the instructions in the knowledge base article Sonja linked to. Perhaps that article should be updated to include this step for linux users?
0 -
Thank you for the feedback, Aaron! We just updated the knowledge base article.
Cheers,
Matthias0
Please sign in to leave a comment.
Comments
4 comments