2017-03-18 9 views
1
##Python code## 

import sys 
from math import * 
from PyQt5.QtCore import * 
from PyQt5.QtWidgets import (QApplication, QDialog, QLineEdit, QTextBrowser, 
     QVBoxLayout) 

class Form(QDialog): 
    def __init__(self, parent=None): 
     super(Form, self).__init__(parent) 
     self.browser = QTextBrowser() 
     self.lineedit = QLineEdit("Type an expression and press Enter") 
     self.lineedit.selectAll() 
     layout = QVBoxLayout() 
     layout.addWidget(self.browser) 
     layout.addWidget(self.lineedit) 
     self.setLayout(layout) 
     self.lineedit.setFocus() 
     self.lineedit.returnPressed.connect(self.updateUi) 
     self.setWindowTitle("Calculate") 

    def updateUi(self): 
     try: 
      text = self.lineedit.text() 
      self.browser.append("%s = <b>%s</b>" % (text, eval(text))) 
     except: 
      self.browser.append("<font color=red>%s is invalid!</font>" % text) 
     self.lineedit.setText('') 

if __name__=="__main__": 
    app = QApplication(sys.argv) 
    form = Form() 
    form.show() 
    app.exec_() 


## Use pyinstaller in CMD ## 

C:\Users\john\Desktop\testing>pyinstaller -F --debug testing1.py 
93 INFO: PyInstaller: 3.3.dev0+912586 
93 INFO: Python: 3.5.0 
93 INFO: Platform: Windows-7-6.1.7601-SP1 
93 INFO: wrote C:\Users\john\Desktop\testing\testing1.spec 
109 INFO: UPX is not available. 
109 INFO: Extending PYTHONPATH with paths 
['C:\\Users\\john\\Desktop\\testing', 'C:\\Users\\john\\Desktop\\testing'] 
109 INFO: checking Analysis 
109 INFO: Building Analysis because out00-Analysis.toc is non existent 
109 INFO: Initializing module dependency graph... 
109 INFO: Initializing module graph hooks... 
109 INFO: Analyzing base_library.zip ... 
3931 INFO: running Analysis out00-Analysis.toc 
4336 INFO: Caching module hooks... 
4352 INFO: Analyzing C:\Users\john\Desktop\testing\testing1.py 
4368 INFO: Loading module hooks... 
4368 INFO: Loading module hook "hook-xml.py"... 
4648 INFO: Loading module hook "hook-PyQt5.QtCore.py"... 
4773 INFO: Loading module hook "hook-PyQt5.py"... 
4773 INFO: Loading module hook "hook-encodings.py"... 
4898 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"... 
4914 INFO: Loading module hook "hook-PyQt5.Qt.py"... 
4914 INFO: Loading module hook "hook-pydoc.py"... 
4914 INFO: Loading module hook "hook-PyQt5.QtPrintSupport.py"... 
5007 INFO: Loading module hook "hook-PyQt5.QtGui.py"... 
5584 INFO: Looking for ctypes DLLs 
5600 INFO: Analyzing run-time hooks ... 
5600 INFO: Including run-time hook 'pyi_rth_qt5.py' 
5616 INFO: Including run-time hook 'pyi_rth_qt5plugins.py' 
5616 INFO: Looking for dynamic libraries 
5631 WARNING: lib not found: Qt5Svg.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qsvg.dll 
5647 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\imageformats\qsvg.dll 
5662 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qsvg.dll 
5694 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\imageformats\qtga.dll 
5709 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qtga.dll 
5725 WARNING: lib not found: Qt5PrintSupport.dll dependency of C:\python35\lib\s 
ite-packages\PyQt5\Qt\plugins\printsupport\windowsprintersupport.dll 
5756 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\printsupport\windowsprintersupport.dll 
5772 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\printsupport\windowsprintersupport.dll 
5803 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\platforms\qoffscreen.dll 
5818 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\platforms\qoffscreen.dll 
5850 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\imageformats\qwbmp.dll 
5865 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qwbmp.dll 
5896 WARNING: lib not found: MSVCP140.dll dependency of C:\python35\lib\site-pac 
kages\PyQt5\Qt\plugins\platforms\qwindows.dll 
5928 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\platforms\qwindows.dll 
5959 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\platforms\qwindows.dll 
5990 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\imageformats\qtiff.dll 
6006 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qtiff.dll 
6037 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\platforms\qminimal.dll 
6068 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\platforms\qminimal.dll 
6084 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\imageformats\qico.dll 
6115 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qico.dll 
6130 WARNING: lib not found: Qt5Svg.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\iconengines\qsvgicon.dll 
6146 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\iconengines\qsvgicon.dll 
6162 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\iconengines\qsvgicon.dll 
6193 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\imageformats\qjpeg.dll 
6224 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qjpeg.dll 
6240 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\imageformats\qicns.dll 
6255 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qicns.dll 
6286 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\imageformats\qgif.dll 
6318 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qgif.dll 
6333 WARNING: lib not found: Qt5Core.dll dependency of C:\python35\lib\site-pack 
ages\PyQt5\Qt\plugins\imageformats\qwebp.dll 
6364 WARNING: lib not found: Qt5Gui.dll dependency of C:\python35\lib\site-packa 
ges\PyQt5\Qt\plugins\imageformats\qwebp.dll 
6520 WARNING: lib not found: Qt5Widgets.dll dependency of c:\python35\lib\site-p 
ackages\PyQt5\QtWidgets.pyd 
6536 WARNING: lib not found: Qt5Core.dll dependency of c:\python35\lib\site-pack 
ages\PyQt5\QtWidgets.pyd 
6567 WARNING: lib not found: Qt5Gui.dll dependency of c:\python35\lib\site-packa 
ges\PyQt5\QtWidgets.pyd 
6598 WARNING: lib not found: Qt5Core.dll dependency of c:\python35\lib\site-pack 
ages\PyQt5\QtGui.pyd 
6614 WARNING: lib not found: Qt5Gui.dll dependency of c:\python35\lib\site-packa 
ges\PyQt5\QtGui.pyd 
6645 WARNING: lib not found: Qt5PrintSupport.dll dependency of c:\python35\lib\s 
ite-packages\PyQt5\QtPrintSupport.pyd 
6661 WARNING: lib not found: Qt5Widgets.dll dependency of c:\python35\lib\site-p 
ackages\PyQt5\QtPrintSupport.pyd 
6692 WARNING: lib not found: Qt5Core.dll dependency of c:\python35\lib\site-pack 
ages\PyQt5\QtPrintSupport.pyd 
6708 WARNING: lib not found: Qt5Gui.dll dependency of c:\python35\lib\site-packa 
ges\PyQt5\QtPrintSupport.pyd 
6739 WARNING: lib not found: Qt5Core.dll dependency of c:\python35\lib\site-pack 
ages\PyQt5\QtCore.pyd 
6910 INFO: Looking for eggs 
6910 INFO: Using Python library c:\python35\python35.dll 
6910 INFO: Found binding redirects: 
[] 
6910 INFO: Warnings written to C:\Users\john\Desktop\testing\build\testing1\warn 
testing1.txt 
6926 INFO: checking PYZ 
6926 INFO: Building PYZ because out00-PYZ.toc is non existent 
6926 INFO: Building PYZ (ZlibArchive) C:\Users\john\Desktop\testing\build\testin 
g1\out00-PYZ.pyz 
7597 INFO: Building PYZ (ZlibArchive) C:\Users\john\Desktop\testing\build\testin 
g1\out00-PYZ.pyz completed successfully. 
7597 INFO: checking PKG 
7597 INFO: Building PKG because out00-PKG.toc is non existent 
7597 INFO: Building PKG (CArchive) out00-PKG.pkg 
11481 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully. 
11497 INFO: Bootloader c:\python35\lib\site-packages\PyInstaller\bootloader\Wind 
ows-64bit\run_d.exe 
11497 INFO: checking EXE 
11497 INFO: Building EXE because out00-EXE.toc is non existent 
11497 INFO: Building EXE from out00-EXE.toc 
11512 INFO: Appending archive to EXE C:\Users\john\Desktop\testing\dist\testing1 
.exe 
11528 INFO: Building EXE from out00-EXE.toc completed successfully. 

## Run the exe. ## 

C:\Users\john\Desktop\testing\dist>testing1 
PyInstaller Bootloader 3.x 
LOADER: executable is C:\Users\john\Desktop\testing\dist\testing1.exe 
LOADER: homepath is C:\Users\john\Desktop\testing\dist 
LOADER: _MEIPASS2 is NULL 
LOADER: archivename is C:\Users\john\Desktop\testing\dist\testing1.exe 
LOADER: Extracting binaries 
LOADER: Executing self as child 
LOADER: set _MEIPASS2 to C:\Users\john\AppData\Local\Temp\_MEI30282 
LOADER: Setting up to run child 
LOADER: Creating child process 
LOADER: Waiting for child process to finish... 
PyInstaller Bootloader 3.x 
LOADER: executable is C:\Users\john\Desktop\testing\dist\testing1.exe 
LOADER: homepath is C:\Users\john\Desktop\testing\dist 
LOADER: _MEIPASS2 is C:\Users\john\AppData\Local\Temp\_MEI30282 
LOADER: archivename is C:\Users\john\Desktop\testing\dist\testing1.exe 
LOADER: SetDllDirectory(C:\Users\john\AppData\Local\Temp\_MEI30282) 
LOADER: Already in the child - running user's code. 
LOADER: manifestpath: C:\Users\john\AppData\Local\Temp\_MEI30282\testing1.exe.ma 
nifest 
LOADER: Activation context created 
LOADER: Activation context activated 
LOADER: Python library: C:\Users\john\AppData\Local\Temp\_MEI30282\python35.dll 
LOADER: Loaded functions from Python library. 
LOADER: Manipulating environment (sys.path, sys.prefix) 
LOADER: Pre-init sys.path is C:\Users\john\AppData\Local\Temp\_MEI30282\base_lib 
rary.zip;C:\Users\john\AppData\Local\Temp\_MEI30282 
LOADER: sys.prefix is C:\Users\john\AppData\Local\Temp\_MEI30282 
LOADER: Setting runtime options 
LOADER: Bootloader option: pyi-windows-manifest-filename testing1.exe.manifest 
LOADER: Initializing python 
LOADER: Overriding Python's sys.path 
LOADER: Post-init sys.path is C:\Users\john\AppData\Local\Temp\_MEI30282\base_li 
brary.zip;C:\Users\john\AppData\Local\Temp\_MEI30282 
LOADER: Setting sys.argv 
LOADER: setting sys._MEIPASS 
LOADER: importing modules from CArchive 
LOADER: extracted struct 
LOADER: callfunction returned... 
LOADER: extracted pyimod01_os_path 
LOADER: callfunction returned... 
LOADER: extracted pyimod02_archive 
LOADER: callfunction returned... 
LOADER: extracted pyimod03_importers 
LOADER: callfunction returned... 
LOADER: Installing PYZ archive with Python modules. 
LOADER: PYZ archive: out00-PYZ.pyz 
LOADER: Running pyiboot01_bootstrap.py 
LOADER: Running pyi_rth_qt5.py 
LOADER: Running pyi_rth_qt5plugins.py 
Traceback (most recent call last): 
    File "site-packages\PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 46 
, in <module> 
    File "c:\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", 
line 714, in load_module 
    module = loader.load_module(fullname) 
ImportError: DLL load failed: The specified module could not be found. 
Failed to execute script pyi_rth_qt5plugins 
LOADER: OK. 
LOADER: Cleaning up Python interpreter. 
LOADER: Back to parent (RC: -1) 
LOADER: Doing cleanup 
LOADER: Freeing archive status for C:\Users\john\Desktop\testing\dist\testing1.e 
xe 

Windows 7, python 3.5 PyQt5, pyinstaller 3.3.dev0 + 912586 또는 pyinstaller 3.2.1 (둘 다 시도 함)을 사용했습니다. 내가 dist에서 exe 파일을 실행하려고 할 때. "pyi_rth_qt5plugins 스크립트를 실행하지 못했습니다"라는 메시지가 나타납니다. 제발 도와주세요. 나는 google에 방법을 시도한다 그러나 나는 아직도 그것을 해결할 수 없다. 누구가 그것을 해결할 수 있습니까? 나는 일주일 동안 그것에 갇혀있다. 대신 Python과 PyQt4의 하위 버전으로 변경해야합니까?ImportError : DLL로드 실패 : 지정한 모듈을 찾을 수 없습니다. pyi_rth_qt5plugins 스크립트를 실행하지 못했습니다.

답변

0

는 C에 대한 환경을 설정 : \ Python35-32 해방 \ 사이트 - 패키지 \ \ PyQt5 Qt는 \ \ bin에

1

이 문제는 PyQT 5.7 DLLs are not bundled를 참조 QT DLL의 pyInstaller 중에 (가 번들로 제공되지 않습니다에 의해 발생할 수 있습니다

.

건물과 "--paths"지시문이 잘 작동하고 "DIST"폴더에 생성 된 응용 프로그램이 성공적으로 실행될 수와 예제 코드를 실행 :

pyinstaller --paths C:\Python35-32\Lib\site-packages\PyQt5\Qt\bin test.py 
관련 문제