与Pyinstaller的Or-Tools CP-Sat
使用VS代码,模型在我的PC上工作得很好。一旦我与pyinstaller创建了一个EXE,然后尝试运行.exe没什么可用。一个小窗口出现了1秒,别无其他。我还尝试了一些TK味精盒,但什么也没有发生。
这是我的主要导入:
import csv
import os
import openpyxl
import sft_gen
from ortools.sat.python import cp_model
我的第二文件的导入(sft_gen):
import csv
from tkinter import Tk
from tkinter.filedialog import askopenfilename
当我在cmd提示中运行.EXE时,我会得到: 提示中的错误msg
edit.1。 :测试后,发现:
from ortools.sat.python import cp_model
.EXE无法执行的原因。
解决方案是什么?我真的很想将CP模型部署给其他用户...与此同时,我将尝试其他.EXE应用程序,例如Py2Exe,如果我有任何成功,请在此处提及。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以前问过。
据我了解,Pyinstaller不支持使用本机库的Python模块。
This was asked before.
From what I understand, pyinstaller does not support python module using native libraries.