Python 3.5 + PyQt5到独立的exe

时间:2016-10-25 10:47:59

标签: python py2exe pyinstaller pyqt5 nuitka

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

1 个答案:

答案 0 :(得分:5)

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

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

然后添加路径到PyQt5 dll' s。我用过这个:

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