2

我是编码新手,我需要将我的 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: dll

4

1 回答 1

5

我已经想出了如何使用 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\
于 2016-11-07T14:25:05.250 回答