Error Installing PySCIPOpt on Mac OSX
<p>After installing SCIP Optimization Suite on OS X by compiling the source and installing Cython, </p>

<pre><code>make
make install INSTALLDIR="/usr/local/"
make SHARED=true GMP=false READLINE=false scipoptlib
pip install Cython
</code></pre>

<p>the installation of <code>PySCIPOpt</code> was attempted</p>

<pre><code>git clone https://github.com/SCIP-Interfaces/PySCIPOpt.git
cd PySCIPOpt
$ SCIPOPTDIR=./ python setup.py install
</code></pre>

<p>But this gave an error. Any suggestions?</p>

<pre><code>Traceback (most recent call last):
File "setup.py", line 29, in &lt;module&gt;
scipsrcdir = sorted(scipsrcdir)[-1]  # use the latest version
IndexError: list index out of range
</code></pre>

<hr>

<h2>Problem importing library</h2>

<p>After successfully installing <code>pyscipopt</code>, when the library is being imported using</p>

<pre><code>from pyscipopt.scip import Model
</code></pre>

<p>I get the <code>Library not loaded</code> error</p>

<pre><code>  File "test.py", line 1, in &lt;module&gt;
    from pyscipopt import Model
  File "/Users/test/anaconda/envs/test/lib/python2.7/site-packages/pyscipopt/__init__.py", line 3, in &lt;module&gt;
    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
</code></pre>

<p>After some searching, I tried someone's solution:</p>

<pre><code>export DYLD_LIBRARY_PATH=/path/to/scipoptsuite-3.2.1/lib 
</code></pre>

<p>but running the Python file again gives a different error <code>Symbol not found: _history_length</code></p>

<pre><code>Traceback (most recent call last):
  File "test.py", line 1, in &lt;module&gt;
    from pyscipopt import Model
  File "/Users/test/anaconda/envs/test/lib/python2.7/site-packages/pyscipopt/__init__.py", line 3, in &lt;module&gt;
    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
</code></pre>

<p>When you set the SCIPOPTDIR environment variable, it looks for directories of the form ${SCIPOPTDIR}/scip-*/src.</p>

<p>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".</p>

python osx python-2.7 scip pyscipopt