scip

PySCIPOpt issue on Linux server


I face an issue of running code from PySCIPOpt. I am trying to read a bnatt500.mps file using PySCIPOpt to optimize it as a test. However I face the following issue:

cteckyan@interns-instance:~/scipoptsuite-7.0.0/build$ python "/home/cteckyan/nikhita.txt"
Traceback (most recent call last):
  File "/home/cteckyan/nikhita.txt", line 1, in <module>
    from pyscipopt import Model
  File "/home/cteckyan/.local/lib/python2.7/site-packages/pyscipopt/__init__.py", line 10, in <module>
    from pyscipopt.scip      import Model
ImportError: libscip.so.7.0: cannot open shared object file: No such file or directory

I have previously installed SCIP7.0.0 using makefile instead of Cmake. I have tried deleting and uninstalling SCIP7.0.0, unpacking the tarball again, and reinstalling using CMake. I then reinstalled PySCIPOpt and face this issue. The code I attempted to run is:

from pyscipopt import Model

model = Model()

model.readProblem('bnatt500')

model.optimize()

Could anybody suggest an idea on how to fix this? Thank you so much!


Solution

  • You should add the path of scip/lib (the directory that contains libscip.so) to your LD_LIBRARY_PATH. You can this by running

    export LD_LIBRARY_PATH=<path/to/scip/lib>

    This will tell the system where to look for runtime libraries. If this works, you should add this command to your .bashrc or similar to load it automatically.

    Alternatively, you could install SCIP globally into /lib or /usr/lib.