How to install pyscipopt and its dependency

Viewed 1199

I am trying to install pyscipopt. This should be done using pip install pyscipopt. The only catch is that pyscipopt requires the SCIP Optimization suite. Here is where I am having trouble. I wanted to make sure that my basic steps were correct.

The first way:

Following (https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.md) Download SCIP optimization suite from https://www.scipopt.org/index.php#download

Then cd to my downloads folder. There, there is scipoptsuite-7.0.1.tar

Run

tar xvfz scipoptsuite-7.0.1.tar

cd scipoptsuite-7.0.1

Then, following (https://scipopt.org/doc/html/CMAKE.php)

mkdir build
cd build
cmake ..
make
make check
make install

Alternatively, I also tried using make (https://scipopt.org/doc/html/MAKE.php)

I then either set export SCIPOPTDIR=<path_to_install_dir>, where <path_to_install_dir> is the path to scipoptsuite-7.0.1, in my downloads directory, or I added the scipoptsuite-7.0.1 directory to my $PATH. Either way, pip install pyscipopt worked.

However,

Ultimately I get (on one machine)

   >>> import pyscipopt
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/usr/anaconda/lib/python2.7/site-packages/pyscipopt/__init__.py", line 10, in <module>
        from pyscipopt.scip      import Model
    ImportError: dlopen(/Users/usr/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so, 2): Library not loaded: libscip.7.0.dylib
      Referenced from: /Users/usr/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so
      Reason: image not found

On another machine I get

 >>> import pyscipopt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/s/Library/Python/2.7/lib/python/site-packages/pyscipopt/__init__.py", line 10, in <module>
    from pyscipopt.scip      import Model
ImportError: dlopen(/Users/sam/Library/Python/2.7/lib/python/site-packages/pyscipopt/scip.so, 2): Library not loaded: libscip.7.0.dylib
  Referenced from: /Users/s/Library/Python/2.7/lib/python/site-packages/pyscipopt/scip.so
  Reason: unsafe use of relative rpath libscip.7.0.dylib in /Users/s/Library/Python/2.7/lib/python/site-packages/pyscipopt/scip.so with restricted binary

Is anyone able to install this software on a mac and give me a step by step guide, so at least I know I am not making any obvious mistakes? I guess there may be problems with my computers that can not be resolved, but I wanted to just make sure I had pieced together the instructions from various links correctly..

Another things I tried was just downloading the sh and running sh scipopsuite-[VERSION].sh. This is considerably faster than make/cmake, and gives me what seems to be required in terms of lib, include and headers, but then when I try to pip install pyscipopt I usually get errors of the form scip/scip.h no such file or directory, command gcc failed as in (https://github.com/SCIP-Interfaces/PySCIPOpt/issues/54).

0 Answers
Related