Search code examples
pythonazuredllazure-web-app-servicescip

Getting SCIP Optimization to work on Azure App Service with PySCIPOpt


Question: Given the information below, is this an issue with the installation of PySCIPOpt on Azure? Or issue with the installation of SCIP Optimization Suite on Azure? Is this actually an issue with 32 vs 64? Or are there other unknowns here that prevent this from being possible? How can I intelligently diagnose the root cause? Thank you all in advanced!

Background

The objective is to deploy a web app that can solve IP problems using the SCIP optimization suite via python and its PySCIPOpt package. This web app has been successfully deployed on my local machine.

Setup

Azure Web App (free-tier, Python 3.6.4 x64 extension): The OS is Windows (echo %PROCESSOR_ARCHITECTURE% => x86)

SCIP version 4.0.1: (SCIPOptSuite-4.0.1-win32-VS14.exe) Installed on local machine and copy/pasted folder /SCIPOptSuite 4.0.1 in Program Files (x86) into folder D:/home/site/wwwwroot on Azure. PATH and SCIPOPTDIR variables updated on Azure via a .xdt file. Tested scip.exe in Kudu Debug console and it appears to work on Azure.

PySCIPOpt: Included in the requirements.txt file (pyscipopt, Cython==0.28.2) for app deployment. Message resulting from git push `... pyscipopt in d:\home\python364x64\lib\site-packages ... Cython==0.28.2 in d:\home\python364x64\lib\site-packages

Error message

D:\home\python364x64\lib\site-packages\pyscipopt\__init__.py in <module>

from pyscipopt.scip      import Model 

Django Version: 2.0.4
Exception Type: ImportError
**Exception Value: DLL load failed: %1 is not a valid Win32 application.**
Exception Location: D:\home\python364x64\lib\site-packages\pyscipopt\__init__.py in <module>, line 5
Python Executable:  D:\home\python364x64\python.exe
Python Version: 3.6.4
Python Path:    
['D:\\home\\site\\wwwroot',
 'D:\\home\\site\\wwwroot',
 'D:\\home\\python364x64\\python36.zip',
 'D:\\home\\python364x64\\DLLs',
 'D:\\home\\python364x64\\lib',
 'D:\\home\\python364x64',
 'D:\\home\\python364x64\\lib\\site-packages',
 'D:\\home\\site\\wwwroot\\backend',
 'C:\\gurobi10\\win32\\python2.5\\lib',
 'C:\\gurobi10\\win32\\python2.5\\lib',
 'D:\\home\\site\\wwwroot\\backend',
 'D:\\home\\site\\wwwroot\\backend']

Solution

  • You seem to use an outdated version of the SCIP Opt Suite (4.0.1). PySCIPOpt is only compatible to the latest version 5.0.1. And I strongly discourage you from using older versions of either software package.

    Did you make sure that you are respecting the licensing terms of SCIP?