After installing SCIP Optimization Suite on OS X by compiling the source and installing Cython,
make
make install INSTALLDIR="/usr/local/"
make SHARED=true GMP=false READLINE=false scipoptlib
pip install Cython
the installation of PySCIPOpt
was attempted
git clone https://github.com/SCIP-Interfaces/PySCIPOpt.git
cd PySCIPOpt
$ SCIPOPTDIR=./ python setup.py install
But this gave an error. Any suggestions?
Traceback (most recent call last):
File "setup.py", line 29, in <module>
scipsrcdir = sorted(scipsrcdir)[-1] # use the latest version
IndexError: list index out of range
After successfully installing pyscipopt
, when the library is being imported using
from pyscipopt.scip import Model
I get the Library not loaded
error
File "test.py", line 1, in <module>
from pyscipopt import Model
File "/Users/test/anaconda/envs/test/lib/python2.7/site-packages/pyscipopt/__init__.py", line 3, in <module>
from pyscipopt.scip import Model
ImportError: dlopen(/Users/test/anaconda/envs/test/lib/python2.7/site-packages/pyscipopt/scip.so, 2): Library not loaded: lib/libscipopt-3.2.1.darwin.x86_64.gnu.opt.so
Referenced from: /Users/test/anaconda/envs/test/lib/python2.7/site-packages/pyscipopt/scip.so
Reason: image not found
After some searching, I tried someone's solution:
export DYLD_LIBRARY_PATH=/path/to/scipoptsuite-3.2.1/lib
but running the Python file again gives a different error Symbol not found: _history_length
Traceback (most recent call last):
File "test.py", line 1, in <module>
from pyscipopt import Model
File "/Users/test/anaconda/envs/test/lib/python2.7/site-packages/pyscipopt/__init__.py", line 3, in <module>
from pyscipopt.scip import Model
ImportError: dlopen(/Users/test/anaconda/envs/test/lib/python2.7/site-packages/pyscipopt/scip.so, 2): Symbol not found: _history_length
Referenced from: /Users/test/Desktop/scipoptsuite-3.2.1/lib/libscipopt-3.2.1.darwin.x86_64.gnu.opt.so
Expected in: flat namespace
in /Users/test/Desktop/scipoptsuite-3.2.1/lib/libscipopt-3.2.1.darwin.x86_64.gnu.opt.so
When you set the SCIPOPTDIR environment variable, it looks for directories of the form ${SCIPOPTDIR}/scip-*/src.
You get that error because you do not have any directories that match that form in a freshly cloned checkout of PySCIPopt.git. You need to set that environment variable to the directory where you installed the "SCIP Optimization Suite".
You need to have SCIP installed first. The shared library of the SCIP Optimization Suite to be precise. The environment variable SCIPOPTDIR must then be set to its root directory - not the directory of the Python interface. Please follow the instructions in the INSTALL file carefully: https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.md
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.