pip install pyscipopt on mac - scip.h file not found

2.2k views Asked by At

Initial Question I've installed scipopsuite by following these instructions: http://scip.zib.de/doc/html/MAKE.php#BRIEFINSTALL

Make tests - complete without error.

Then when I try pip install pyscipopt I get the following error.

src/pyscipopt/scip.c:467:10: fatal error: 'scip/scip.h' file not found
#include "scip/scip.h"
         ^
1 error generated.
error: command 'gcc' failed with exit status 1

Specs: Anaconda Python 2.7, latest OSX

Follow Up In response to comments(@mattmilten), I've done the following.

(1) Installed the make file - When i tried to run the install it failed because the name of the O.darwin.x86_64.gnu.shared.opt folder was set to 'static' instead of shared. I changed that name and then the install completed but did have these warnings:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libscipopt-4.0.0.darwin.x86_64.gnu.opt.a(stkchk.o) has no symbols 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libscipopt-4.0.0.darwin.x86_64.gnu.opt.a(stkchk.o) has no symbols

When i try:

>>> import pyscipopt

, I now get the following error.

Any suggestions would be appreciated.

ImportError: dlopen(/Users/"local"/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so, 2): Symbol not found: ___gmp_version
Referenced from: /Users/"local"/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so
Expected in: flat namespace in /Users/"local"/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so    

I'm guessing these things are linked - thanks.

1

There are 1 answers

1
mattmilten On

As explained in the PySCIPOpt INSTALL you need to tell Python where you installed the SCIP Opt Suite: export SCIPOPTDIR=<path_to_install_dir> The setup.py looks for this environment variable so you need to set it before you run pip install pyscipopt

Edit:

You need to install the SCIP Opt Suite (this basically copies the compiled files to some directory) as also explained in the INSTALL file