gpt4 book ai didi

Python 3.5 + PyQt5 到独立的 exe

转载 作者:行者123 更新时间:2023-11-28 21:44:53 25 4
gpt4 key购买 nike

我是编码新手,我需要将我的 py 文件转换为 exe。我试过 py2exe 但它不适用于 python 3.5。然后我尝试了pyinstaller,它成功了,但是当我在程序中添加PyQt5时,pyinstaller也失败了。我尝试了 nuitka,它构建了 exe,但是当我单击 exe 文件时,它会显示一个控制台几秒钟然后关闭。我需要一个在激活后显示 gui 的 exe。以下是我在程序中使用的模块:

import P4
import time
from datetime import datetime,date
import traceback
import os
import sys
import threading
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5.QtWidgets import *
from PyQt5.QtCore import QCoreApplication, QTimer

我从 nuitka exe 文件中得到的错误: error_0ne

我从 pyinstaller exe 文件中得到的错误:

Er2

pyinstaller 需要的 Dll: dlls

最佳答案

我已经弄清楚如何使用 Python 3.5 和 pyinstaller 制作 exe。你需要安装这个:

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip --upgrade

然后添加 PyQt5 dll 的路径。我用过这个:

pyinstaller -y --clean --paths C:\TEMP\env\Lib\site-packages\PyQt5\Qt\bin\

关于Python 3.5 + PyQt5 到独立的 exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40237972/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com