1

I usually use SCIP (call PyScipOpt) with Jupyter Notebook (installed via Anaconda) on my Mac, and when I write "from pyscipopt import Model" there is no error (when running it on my machine) but for the large-scale problems I decided to import my notebook to Google Colab and run the code there. Cannot get rid of the error: "no module named pyscipopt".

I tried "!pip install pyscipopt" directly in google colab, and "!apt install pyscipopt". While executing "!pip install pyscipopt", I got another error: "failed building wheel for pyscipopt". When I googled it, I found that the SCIP should be installed prior etc. but I said everything is working fine on Jupyter Notebook directly on my Mac which means SCIP is installed and lib and include subpackages are there (I checked). I also tried "export SCIPOPTDIR=" and "!export SCIPOPTDIR=". Nothing works.

Any advise would be much appreciated.

Thanks! Lidiia

Lidiia S
  • 11
  • 1

1 Answers1

1

From pip or PyPI you cannot install SCIP but only PySCIPOpt. You need to use the conda package that includes SCIP to use PySCIPOpt in a hosted Google Colab notebook.

First, you need to install conda itself:

!pip install -q condacolab
import condacolab
condacolab.install()

Then, you can install PySCIPOpt:

!conda install pyscipopt

Finally, you can import PySCIPOpt as usual:

from pyscipopt import Model
m = Model()
m.redirectOutput()
m.printVersion()
mattmilten
  • 6,242
  • 3
  • 35
  • 65