与Pyinstaller的Or-Tools CP-Sat

发布于 2025-02-13 09:53:05 字数 699 浏览 0 评论 0原文

使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼泪淡了忧伤 2025-02-20 09:53:05

以前问过。
据我了解,Pyinstaller不支持使用本机库的Python模块。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文