Python 3.x 在自动py-to-exe中编译后,无法执行pyiboot01\u引导

Python 3.x 在自动py-to-exe中编译后,无法执行pyiboot01\u引导,python-3.x,compiler-errors,Python 3.x,Compiler Errors,该程序包括一个带有tkinter、多线程的普通python脚本,以及一些连接到sqlite数据库的函数。该程序作为一个.py文件运行非常平稳,但在自动py to exe中编译后,它总是显示一条致命错误的消息无法执行脚本pyiboot01\u bootstrap,它甚至不是我的.exe文件的名称。我试着把-d标记放在toall上,但它仍然没有显示错误回溯。我是否应该重新安装自动复制到exe?编译时的输出如下所示 Running auto-py-to-exe v2.6.6 Building in t

该程序包括一个带有
tkinter
多线程
的普通python脚本,以及一些连接到
sqlite
数据库的函数。该程序作为一个
.py
文件运行非常平稳,但在
自动py to exe
中编译后,它总是显示一条
致命错误的消息
无法执行脚本pyiboot01\u bootstrap
,它甚至不是我的
.exe
文件的名称。我试着把
-d
标记放在to
all
上,但它仍然没有显示错误回溯。我是否应该重新安装
自动复制到exe
?编译时的输出如下所示

Running auto-py-to-exe v2.6.6
Building in the current instances temporary directory at C:\Users\Spanish\AppData\Local\Temp\tmpb2b4goux
To get a new temporary directory, restart this application
Recursion Limit is set to 5000
Executing: pyinstaller -y -w -i "C:/LoLPingStreaming/media/icon.ico" --add-data "C:/LoLPingStreaming/testerdata.db";"." --add-data "C:/LoLPingStreaming/media";"media/" --debug all  "C:/LoLPingStreaming/LoLPingStreaming.py"
68263 INFO: PyInstaller: 3.6
68263 INFO: Python: 3.7.0
68263 INFO: Platform: Windows-7-6.1.7601-SP1
68263 INFO: wrote C:\Users\Spanish\AppData\Local\Temp\tmpb2b4goux\LoLPingStreaming.spec
68273 INFO: UPX is not available.
68273 INFO: Extending PYTHONPATH with paths
['C:\\LoLPingStreaming',
 'C:\\Users\\Spanish\\AppData\\Local\\Temp\\tmpb2b4goux']
68273 INFO: checking Analysis
68273 INFO: Building Analysis because Analysis-00.toc is non existent
68273 INFO: Initializing module dependency graph...
68325 INFO: Caching module graph hooks...
68668 INFO: Analyzing base_library.zip ...
79798 INFO: Caching module dependency graph...
80039 INFO: running Analysis Analysis-00.toc
80145 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\spanish\appdata\local\programs\python\python37-32\python.exe
81487 INFO: Analyzing C:\LoLPingStreaming\LoLPingStreaming.py
82097 INFO: Processing pre-safe import module hook   six.moves
84947 INFO: Processing pre-find module path hook   distutils
84991 INFO: distutils: retargeting to non-venv dir 'c:\\users\\spanish\\appdata\\local\\programs\\python\\python37-32\\lib'
88497 INFO: Processing pre-find module path hook   site
88536 INFO: site: retargeting to fake-dir 'c:\\users\\spanish\\appdata\\local\\programs\\python\\python37-32\\lib\\site-packages\\PyInstaller\\fake-modules'
91849 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
97787 INFO: Processing module hooks...
97797 INFO: Loading module hook "hook-distutils.py"...
97908 INFO: Loading module hook "hook-encodings.py"...
98130 INFO: Loading module hook "hook-gevent.py"...
99927 INFO: Determining a mapping of distributions to packages...
107866 WARNING: Unable to find package for requirement greenlet from package gevent.
107866 INFO: Packages required by gevent:
['cffi']
114026 INFO: Loading module hook "hook-lib2to3.py"...
114207 INFO: Loading module hook "hook-PIL.Image.py"...
115526 INFO: Loading module hook "hook-PIL.py"...
115536 INFO: Excluding import 'PySide'
115546 INFO:   Removing import of PySide from module PIL.ImageQt
115546 INFO: Excluding import 'PyQt4'
115565 INFO:   Removing import of PyQt4 from module PIL.ImageQt
115568 INFO: Import to be excluded not found: 'FixTk'
115568 INFO: Excluding import 'tkinter'
115574 INFO:   Removing import of tkinter from module PIL.ImageTk
115575 INFO: Excluding import 'PyQt5'
115580 INFO:   Removing import of PyQt5 from module PIL.ImageQt
115584 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
115602 INFO: Import to be excluded not found: 'FixTk'
115602 INFO: Excluding import 'tkinter'
115605 INFO: Loading module hook "hook-pkg_resources.py"...
117346 INFO: Processing pre-safe import module hook   win32com
117736 INFO: Excluding import '__main__'
117736 INFO:   Removing import of __main__ from module pkg_resources
117736 INFO: Loading module hook "hook-pycparser.py"...
117777 INFO: Loading module hook "hook-pydoc.py"...
117779 INFO: Loading module hook "hook-pythoncom.py"...
118986 INFO: Loading module hook "hook-pywintypes.py"...
120639 INFO: Loading module hook "hook-setuptools.py"...
122675 INFO: Loading module hook "hook-sqlite3.py"...
123465 INFO: Loading module hook "hook-sysconfig.py"...
123475 INFO: Loading module hook "hook-win32com.py"...
124662 INFO: Loading module hook "hook-xml.py"...
124855 INFO: Loading module hook "hook-_tkinter.py"...
125277 INFO: checking Tree
125277 INFO: Building Tree because Tree-00.toc is non existent
125277 INFO: Building Tree Tree-00.toc
126097 INFO: checking Tree
126097 INFO: Building Tree because Tree-01.toc is non existent
126097 INFO: Building Tree Tree-01.toc
126306 INFO: Looking for ctypes DLLs
126485 INFO: Analyzing run-time hooks ...
126505 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
126553 INFO: Including run-time hook 'pyi_rth_pkgres.py'
126573 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
126585 INFO: Including run-time hook 'pyi_rth__tkinter.py'
126618 INFO: Looking for dynamic libraries
128807 INFO: Looking for eggs
128807 INFO: Using Python library c:\users\spanish\appdata\local\programs\python\python37-32\python37.dll
128807 INFO: Found binding redirects: 
[]
135234 INFO: Warnings written to C:\Users\Spanish\AppData\Local\Temp\tmpb2b4goux\build\LoLPingStreaming\warn-LoLPingStreaming.txt
135526 INFO: Graph cross-reference written to C:\Users\Spanish\AppData\Local\Temp\tmpb2b4goux\build\LoLPingStreaming\xref-LoLPingStreaming.html
135681 INFO: Appending 'datas' from .spec
135779 INFO: checking PYZ
135779 INFO: Building PYZ because PYZ-00.toc is non existent
135779 INFO: Building PYZ (ZlibArchive) C:\Users\Spanish\AppData\Local\Temp\tmpb2b4goux\build\LoLPingStreaming\PYZ-00.pyz
135779 INFO: Building PYZ (ZlibArchive) C:\Users\Spanish\AppData\Local\Temp\tmpb2b4goux\build\LoLPingStreaming\PYZ-00.pyz completed successfully.
135789 INFO: checking PKG
135799 INFO: Building PKG because PKG-00.toc is non existent
135799 INFO: Building PKG (CArchive) PKG-00.pkg
135933 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
135943 INFO: Bootloader c:\users\spanish\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\runw_d.exe
135943 INFO: checking EXE
135943 INFO: Building EXE because EXE-00.toc is non existent
135943 INFO: Building EXE from EXE-00.toc
136023 INFO: Copying icons from ['C:\\LoLPingStreaming\\media\\icon.ico']
136080 INFO: Writing RT_GROUP_ICON 0 resource with 90 bytes
136080 INFO: Writing RT_ICON 1 resource with 24702 bytes
136080 INFO: Writing RT_ICON 2 resource with 67624 bytes
136080 INFO: Writing RT_ICON 3 resource with 16936 bytes
136080 INFO: Writing RT_ICON 4 resource with 9640 bytes
136080 INFO: Writing RT_ICON 5 resource with 4264 bytes
136080 INFO: Writing RT_ICON 6 resource with 1128 bytes
136107 INFO: Appending archive to EXE C:\Users\Spanish\AppData\Local\Temp\tmpb2b4goux\build\LoLPingStreaming\LoLPingStreaming.exe
136111 INFO: Building EXE from EXE-00.toc completed successfully.
136125 INFO: checking COLLECT
136126 INFO: Building COLLECT because COLLECT-00.toc is non existent
136128 INFO: Building COLLECT COLLECT-00.toc
155059 INFO: Building COLLECT COLLECT-00.toc completed successfully.
Moving project to: C:\Users\Spanish\output
Complete.

谢谢


编辑: 从模块
Pyrastery
中找出影响的代码块,我想做的是:
tkinter
不提供显示系统托盘图标的方法,因此,我能够找到另一种方法,用
模块实现托盘图标,并让它在另一个
线程中运行,这样它就可以与
tkinter的主线程同时运行。以下是我对模块的实现,在注释掉并编译后没有显示上述错误:

import...
import pystray
from pystray import MenuItem as item

...
class Gui:
    def __init__(self, master):
        self.iconthread = threading.Thread(target=self.systray, args=())
        self.iconthread.setDaemon(True)
        self.iconthread.start()
        ...
    ...
    def systray(self):
        image = Image.open('media/icon.png')
        menu = pystray.Menu(item('Show Ping', self.show, default=True, visible=False), item('Exit', app.close))
        self.icon = pystray.Icon('Ping', image, 'Ping', menu)
        self.icon.run()
...


这是我实现这个模块的方式错误,或者与
线程有关,尽管还有一个
线程也在运行,但不会产生任何错误。

在计算出一天之后,通过在
tkinter\uuuuuuu()以外的其他地方打开
线程来修复它
,编译后,现在不会出现错误,运行平稳

import...
import pystray
from pystray import MenuItem as item
...
Class App:
    def __init__():
        ...

    def startthreading(self):
        self.iconthread = threading.Thread(target=self.systray, args=())
        self.iconthread.setDaemon(True)
        self.iconthread.start()

    def systray(self):
        image = Image.open('media/icon.png')
        menu = pystray.Menu(item('Show Ping', self.show, default=True, visible=False))
        self.icon = pystray.Icon('Ping', image, 'Ping', menu)
        self.icon.run()
...
class Gui:
    def __init__(self, master):
        app.startthreading()
        #self.iconthread = threading.Thread(target=self.systray, args=())
        #self.iconthread.setDaemon(True)
        #self.iconthread.start()
        ...
    ...
    #def systray(self):
        #image = Image.open('media/icon.png')
        #menu = pystray.Menu(item('Show Ping', self.show, default=True, visible=False), item('Exit', app.close))
        #self.icon = pystray.Icon('Ping', image, 'Ping', menu)
        #self.icon.run()
...
if __name__ == '__main__':
    app = App()
    gui = Gui()