1
votes

I've tried unsuccessfully to get scip running with python. I'm using Yosemite (10.10.3), python 2.7 and have installed scip optimization suit (http://scip.zib.de/download.php?fname=scipoptsuite-3.1.1.tgz) with make.

I can start scip after the installation via the terminal.

sages-MBP:~ sage$ scip SCIP version 3.1.1 [precision: 8 byte] [memory: block] >[mode:optimized][LP solver: SoPlex 2.0.1] [GitHash: bade511] 

But when I try to use import scip in python there appears the message

No module named scip

The same error message appears for from zibopt import scip

If I print the system path with print sys.path in python, the folder scipoptsuite-3.1.1/scip-3.1.1/bin is included where the file scip-3.1.1.darwin.x86_64.gnu.opt.spx is situated. Is it possible that the reason for the error message is that I haven't linked correctly necessary libraries?

Or which folders have to be included in the pythonpath to get scip working?

I Hope someone can help me out!

1
The file scip-3.1.1.darwin.x86_64.gnu.opt.spx isn't what you need, it's going to be named either scip.py or scip.so (or possibly scip-stuff-other-stuff.so, but usually not for 2.x). Whatever directory has that file is the one that has to be on your sys.path. - abarnert
(Unless scip actually installs a special module loader for .spx files, but I doubt it does.) - abarnert
The actual scip.py folder has to be either in the sys.path or inside the directory where your python file is located. Even if scip.py was blank, you wouldn't get the error, indicating the module is not in either of the places it should be. - Andriko13
Try changing into the directory where you unpacked the SCIP tarball, and installing the headers, libraries, and binary. Not sure if you did that step. - Andriko13
I've done make and sudo make install INSTALLDIR="/usr/local/ in 'scip-3.1.1', but I couldn't find a file scip.py or scip-stuff-other-stuff.so in the '/usr/local/' or its subfolders either. - саша

1 Answers

1
votes

You need to install the python interface that comes with SCIP. Go to scip/interfaces/python/ and read the instructions in README and INSTALL. This interface is using Cython to communicate with the C-Code of SCIP.

make will only install the native Linux or Mac binaries/libraries.

The environment variable DYLD_LIBRARY_PATH needs to be set to contain the lib/ directory of the SCIPoptSuite installation (see comment by @саша)