如何将.py和.ui(pyqt5 gui)文件转换为.exe

时间:2019-10-23 03:45:39

标签: python-3.x pyqt5 pyinstaller

我分别使用PyQt5 GUI(.ui文件),并将其与我的.py文件一起使用,程序使用的是pandas从GUI行编辑中获取输入,并在excel(pandas数据框)中进行一些搜索,然后在GUI上显示输出Qtableview。 (cdpt.ui,cdptsearchtoll.py,cdpt.xlsx chromedriver和pyicon.ico在文件夹中) 我的熊猫也使用read_html。 现在,我想使用正在执行的pyinstaller制作一个.exe文件,但出现错误“无法执行脚本” 我是pyinstaller的新手,无法确定问题出在哪里?除此之外,我的代码运行正常。符合预期! 请看下面

C:\Users\AB43399\Desktop\cdpt_search_tool>pyinstaller -w -F -i 
"C:\Users\AB43399\Desktop\cdpt_search_tool\pyicon.ico" cdptsearchtool.py
1220 INFO: PyInstaller: 3.4
1220 INFO: Python: 3.7.1
1221 INFO: Platform: Windows-10-10.0.16299-SP0
1231 INFO: wrote C:\Users\AB43399\Desktop\cdpt_search_tool\cdptsearchtool.spec
1238 INFO: UPX is not available.
1247 INFO: Extending PYTHONPATH with paths
['C:\\Users\\AB43399\\Desktop\\cdpt_search_tool',
'C:\\Users\\AB43399\\Desktop\\cdpt_search_tool']
1247 INFO: checking Analysis
1251 INFO: Building Analysis because Analysis-00.toc is non existent
1252 INFO: Initializing module dependency graph...
1273 INFO: Initializing module graph hooks...
1350 INFO: Analyzing base_library.zip ...
10235 INFO: running Analysis Analysis-00.toc
10317 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\ab43399\appdata\local\programs\python\python37\python.exe
12527 INFO: Caching module hooks...
12717 INFO: Analyzing C:\Users\AB43399\Desktop\cdpt_search_tool\cdptsearchtool.py
13790 INFO: Processing pre-find module path hook   PyQt5.uic.port_v3
13970 INFO: Processing pre-find module path hook   PyQt5.uic.port_v2
14984 INFO: Processing pre-find module path hook   distutils
15954 INFO: Processing pre-safe import module hook   six.moves
23920 INFO: Processing pre-find module path hook   site
23964 INFO: site: retargeting to fake-dir 
'c:\\users\\ab43399\\appdata\\local\\programs\\python\\python37\\lib\\site- 
packages\\PyInstaller\\fake-modules'
26263 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
70917 INFO: Loading module hooks...
70917 INFO: Loading module hook "hook-distutils.py"...
71040 INFO: Loading module hook "hook-encodings.py"...
71585 INFO: Loading module hook "hook-jinja2.py"...
71673 INFO: Loading module hook "hook-lib2to3.py"...
72000 INFO: Loading module hook "hook-lxml.etree.py"...
72003 INFO: Loading module hook "hook-numpy.core.py"...
74268 INFO: Loading module hook "hook-numpy.py"...
74308 INFO: Loading module hook "hook-openpyxl.py"...
74594 INFO: Loading module hook "hook-pandas.py"...
84003 INFO: Loading module hook "hook-PIL.Image.py"...
86446 INFO: Loading module hook "hook-PIL.py"...
86479 INFO: Excluding import 'PySide'
86481 INFO:   Removing import of PySide from module PIL.ImageQt
86482 INFO: Excluding import 'PyQt5'
86485 INFO:   Removing import of PyQt5.QtCore from module PIL.ImageQt
86485 INFO:   Removing import of PyQt5.QtGui from module PIL.ImageQt
86486 INFO: Excluding import 'tkinter'
86488 INFO:   Removing import of tkinter from module PIL.ImageTk
86489 INFO: Excluding import 'PyQt4'
86493 INFO:   Removing import of PyQt4 from module PIL.ImageQt
86494 INFO: Import to be excluded not found: 'FixTk'
86494 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
86499 INFO: Import to be excluded not found: 'FixTk'
86500 INFO: Excluding import 'tkinter'
86502 INFO: Loading module hook "hook-pkg_resources.py"...
88979 INFO: Processing pre-safe import module hook   win32com
89480 INFO: Loading module hook "hook-pycparser.py"...
89493 INFO: Loading module hook "hook-pydoc.py"...
89507 INFO: Loading module hook "hook-PyQt5.py"...
91328 WARNING: Hidden import "sip" not found!
91334 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
91824 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
92457 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
93499 INFO: Loading module hook "hook-PyQt5.uic.py"...
93571 INFO: Loading module hook "hook-pytest.py"...
102252 INFO: Loading module hook "hook-pythoncom.py"...
104849 INFO: Loading module hook "hook-pytz.py"...
105540 INFO: Loading module hook "hook-pywintypes.py"...
108030 INFO: Loading module hook "hook-setuptools.py"...
111619 INFO: Loading module hook "hook-sqlite3.py"...
112534 INFO: Loading module hook "hook-sysconfig.py"...
112605 INFO: Loading module hook "hook-win32com.py"...
114057 INFO: Loading module hook "hook-xml.dom.domreg.py"...
114058 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
114076 INFO: Loading module hook "hook-xml.py"...
114078 INFO: Loading module hook "hook-_tkinter.py"...
116028 INFO: checking Tree
116033 INFO: Building Tree because Tree-00.toc is non existent
116033 INFO: Building Tree Tree-00.toc
116557 INFO: checking Tree
116558 INFO: Building Tree because Tree-01.toc is non existent
116558 INFO: Building Tree Tree-01.toc
116796 INFO: Looking for ctypes DLLs
116930 INFO: Analyzing run-time hooks ...
116943 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
116999 INFO: Including run-time hook 'pyi_rth_pkgres.py'
117006 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
117013 INFO: Including run-time hook 'pyi_rth_qt5.py'
117060 INFO: Looking for dynamic libraries
122552 INFO: Looking for eggs
122552 INFO: Using Python library 
c:\users\ab43399\appdata\local\programs\python\python37\python37.dll
122554 INFO: Found binding redirects:
[]
122614 INFO: Warnings written to 
C:\Users\AB43399\Desktop\cdpt_search_tool\build\cdptsearchtool\warn-cdptsearchtool.txt
122960 INFO: Graph cross-reference written to 
C:\Users\AB43399\Desktop\cdpt_search_tool\build\cdptsearchtool\xref-cdptsearchtool.html
123141 INFO: checking PYZ
123141 INFO: Building PYZ because PYZ-00.toc is non existent
123142 INFO: Building PYZ (ZlibArchive) 
C:\Users\AB43399\Desktop\cdpt_search_tool\build\cdptsearchtool\PYZ-00.pyz
126145 INFO: Building PYZ (ZlibArchive) 
C:\Users\AB43399\Desktop\cdpt_search_tool\build\cdptsearchtool\PYZ-00.pyz completed successfully.
126227 INFO: checking PKG
126227 INFO: Building PKG because PKG-00.toc is non existent
126228 INFO: Building PKG (CArchive) PKG-00.pkg
129181 WARNING: One binary added with two internal names.
129181 WARNING: ('libGLESv2.dll',
'C:\\users\\ab43399\\appdata\\local\\programs\\python\\python37\\lib\\site- 
 packages\\PyQt5\\Qt\\bin\\libGLESv2.dll',
 'BINARY')
 129184 WARNING: was placed previously at
 129184 WARNING: ('PyQt5\\Qt\\bin\\libGLESv2.dll',
'C:\\users\\ab43399\\appdata\\local\\programs\\python\\python37\\lib\\site- 
packages\\PyQt5\\Qt\\bin\\libGLESv2.dll',
'BINARY')
157741 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
157789 INFO: Bootloader c:\users\ab43399\appdata\local\programs\python\python37\lib\site- 
packages\PyInstaller\bootloader\Windows-64bit\runw.exe
157789 INFO: checking EXE
157790 INFO: Building EXE because EXE-00.toc is non existent
157790 INFO: Building EXE from EXE-00.toc
157897 INFO: SRCPATH [('C:\\Users\\AB43399\\Desktop\\cdpt_search_tool\\pyicon.ico', None)]
157897 INFO: Updating icons from ['C:\\Users\\AB43399\\Desktop\\cdpt_search_tool\\pyicon.ico'] to 
C:\Windows\Temp\tmplqtaq2qp
157915 INFO: Writing RT_GROUP_ICON 0 resource with 132 bytes
157915 INFO: Writing RT_ICON 1 resource with 5355 bytes
157916 INFO: Writing RT_ICON 2 resource with 67624 bytes
157917 INFO: Writing RT_ICON 3 resource with 38056 bytes
157917 INFO: Writing RT_ICON 4 resource with 21640 bytes
157919 INFO: Writing RT_ICON 5 resource with 16936 bytes
157919 INFO: Writing RT_ICON 6 resource with 9640 bytes
157919 INFO: Writing RT_ICON 7 resource with 4264 bytes
157920 INFO: Writing RT_ICON 8 resource with 2440 bytes
157920 INFO: Writing RT_ICON 9 resource with 1128 bytes
157933 INFO: Appending archive to EXE 
C:\Users\AB43399\Desktop\cdpt_search_tool\dist\cdptsearchtool.exe
158455 INFO: Building EXE from EXE-00.toc completed successfully.

我看到过警告一两个地方 像

91328 WARNING: Hidden import "sip" not found!
129181 WARNING: One binary added with two internal names.

但我不知道缺少什么,如何解决这些问题,是造成问题的那个人?

非常感谢您的帮助/指导!

0 个答案:

没有答案