2

I am trying to install pyscipopt from the SCIP Optimization Suite in order to use SCIP solver in Python. I already downloaded SCIP Optimization Suite from the SCIP Website. Unfortunately, my mac terminal returns an error when trying: "pip install pyscipopt".see screenshot

Does anyone know, why it doesn't work?

And might anyone have an alternative idea on how to get pyscipopt running for Python on macOS?

Thank you for your help in advance!

LukPau
  • 23
  • 2

3 Answers3

1

Judging from the error in your screenshot (scip.h not found) it is very likely that you did not specify the SCIP installation directory correctly or did not install SCIP correctly.

The easiest way to get PySCIPOpt running nowadays is probably using conda as this will also install the SCIP Optimization Suite:

conda install --channel conda-forge pyscipopt

Please refer to the full installation instructions for further information on the other installation methods.

mattmilten
  • 6,242
  • 3
  • 35
  • 65
  • Thank you for your fast response and explanation. I tried installing PySCIPOpt using conda, but there occured another error. It starts with: "Collecting package metadata (current_repodata.json): done." Then, when it says: "Solving environment: ..." Then there occurs an error: "failed with initial frozen solve. Retrying with flexible solve". After iterating some time, it says: "Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort". And then it goes through various pakages/files and examines conflicts for hours. – LukPau Feb 14 '22 at 12:52
  • Do you have an idea, why it does not install PySCIPOpt via Anaconda? – LukPau Feb 14 '22 at 12:53
  • Maybe try a different Python version in your env and check which versions are available on conda for macOS? – mattmilten Feb 14 '22 at 21:16
0

Thank you @mattmilten for your help, your last advice worked! I created a new environment in Anaconda and used Python 3.8 instead of Python 3.9. Then I was able to install PySCIPOpt in this environment - it is running now

LukPau
  • 23
  • 2
  • You do not need to post your gratitude as an answer. Please post it as a comment to the selected answer post as it is a continuation of the selected answer. – Naeem Khan Feb 20 '22 at 04:27
0

You can also consider running it in a Docker container. Here is an example Dockerfile:

ARG DISTRO_VERSION="4.10.3-alpine"

FROM continuumio/miniconda3:${DISTRO_VERSION} AS base

COPY environment.yml /home/

RUN conda env create --file /home/environment.yml && \
    conda clean --all

And associated environment.yml file:

name: env-name
channels:
  - defaults
  - conda-forge
dependencies:
  - pyscipopt==3.5.0
Paul Bendevis
  • 2,381
  • 2
  • 31
  • 42