Search code examples
pyinstallerexeor-toolscp-sat

OR-Tools CP-Sat with Pyinstaller


Model works pretty fine on my pc using VS Code. Once I create an exe with pyinstaller and try to run the .exe nothing works. A small window appears for 1 sec and nothing else. I also tried some tk msg box and nothing happens.

Here are the imports of my main :

import csv
import os 
import openpyxl
import sft_gen
from ortools.sat.python import cp_model

The imports of my 2nd file (sft_gen):

import csv
from tkinter import Tk
from tkinter.filedialog import askopenfilename

When I run the .exe in the cmd prompt I get : Error msg in prompt

Edit.1. : After testing, found out that :

from ortools.sat.python import cp_model

is the reason why the .exe fails to execute.

What could be the solution to this? I really want to deploy my CP model to other users... In the meantime I'll try other .exe apps like py2exe and mention here if I have any success with it.


Solution

  • This was asked before. From what I understand, pyinstaller does not support python module using native libraries.